<commit_before>#!/util/bin/perl
$|++;
use strict;

if (scalar(@ARGV) != 1 ) {
    die("usage vcf_to_germline_maflite.pl <normalAlias>\n");
}
 
my ($normalAlias) = @ARGV;
my $line;
while (defined($line = <STDIN>)) {
    if ($line =~ /#/) { next; }

    my ($chrom, $pos, $rsName, $ref, $alt, $qual, $filter, $info, $format, $sampleA) = split("\t", $line);

    my ($genoNum) = split(":", $sampleA);
    my ($geno1, $geno2) = split("/",$genoNum);
       
    my $allele1 = "N";
    my $allele2 = "N";
    if ( $geno1 eq "0") { 
        $allele1 = $ref;
    } elsif ($geno1 eq "1") {
        $allele1 = $alt;
    } else {
        die("only handled single alt currently:\n$line \n");
    }

    if ( $geno2 eq "0") { 
        $allele2 = $ref;
    } elsif ($geno2 eq "1") {
        $allele2 = $alt;
    } else {
        die("only handled single alt currently:\n$line\n");
    }

    my $ncbiBuild = "36";
    print join("\t", ($ncbiBuild, $chrom, $pos, $pos, $ref, $allele1, $allele2, $normalAlias, $normalAlias)) . "\n";
}
<commit_msg>Allow no-call alleles to propagate through to the MAF file<commit_after>#!/util/bin/perl
$|++;
use strict;

if (scalar(@ARGV) != 1 ) {
    die("usage vcf_to_germline_maflite.pl <normalAlias>\n");
}
 
my ($normalAlias) = @ARGV;
my $line;
while (defined($line = <STDIN>)) {
    if ($line =~ /#/) { next; }

    my ($chrom, $pos, $rsName, $ref, $alt, $qual, $filter, $info, $format, $sampleA) = split("\t", $line);

    my ($genoNum) = split(":", $sampleA);
    my ($geno1, $geno2) = split("/",$genoNum);
       
    my $allele1 = "N";
    my $allele2 = "N";
    if ( $geno1 eq "0") { 
        $allele1 = $ref;
    } elsif ($geno1 eq "1") {
        $allele1 = $alt;
    } elsif ($geno1 eq ".") {
        # do nothing - just leave the N in place
    } else {
        die("allele1: only handled single alt currently:\n$line \n");
    }

    if ( $geno2 eq "0") { 
        $allele2 = $ref;
    } elsif ($geno2 eq "1") {
        $allele2 = $alt;
    } elsif ($geno2 eq ".") {
        # do nothing - just leave the N in place
    } else {
        die("allele2: only handled single alt currently:\n$line\n");
    }

    my $ncbiBuild = "36";
    print join("\t", ($ncbiBuild, $chrom, $pos, $pos, $ref, $allele1, $allele2, $normalAlias, $normalAlias)) . "\n";
}

{'fraction_non_alphanumeric': 0.20981165133596144, 'fraction_numerical': 0.02014892685063513, 'mean_word_length': 2.5410852713178294, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6638397', 'n_tokens_mistral': 933, 'n_tokens_neox': 902, 'n_words': 231}