| 
0
 | 
     1 #!/usr/bin/perl
 | 
| 
 | 
     2 
 | 
| 
 | 
     3 use strict;
 | 
| 
 | 
     4 use warnings;
 | 
| 
 | 
     5 use Getopt::Long;
 | 
| 
 | 
     6 
 | 
| 
 | 
     7 use Bio::Seq::GenomeID qw(generate_id);
 | 
| 
 | 
     8 
 | 
| 
 | 
     9 my ($outFile, $inFile, $type, $index, $hg);
 | 
| 
 | 
    10 my ($noise, $baq, $sex, $ucn, $ref, $name);
 | 
| 
 | 
    11 
 | 
| 
 | 
    12 GetOptions("o=s"=> \$outFile,
 | 
| 
 | 
    13 				"n=f"=>\$noise,
 | 
| 
 | 
    14 				"hg=s"=> \$hg,
 | 
| 
 | 
    15 				"b=i"=> \$baq,
 | 
| 
 | 
    16 				"s=s"=> \$sex,
 | 
| 
 | 
    17 				"u=s"=> \$ucn,
 | 
| 
 | 
    18 				"r=s"=> \$ref,
 | 
| 
 | 
    19 				"type=s"=> \$type,
 | 
| 
 | 
    20 				"file=s"=> \$inFile,
 | 
| 
 | 
    21 				"sN=s"=> \$name,
 | 
| 
 | 
    22 );
 | 
| 
 | 
    23 $ucn = ($ucn eq "true")? 1:0; $sex = ($sex eq "true")?1:0; $ref = ($ref eq "true")?1:0;
 | 
| 
 | 
    24 
 | 
| 
 | 
    25 my %obj;
 | 
| 
 | 
    26 $obj{'type'} = $type; $obj{'file'} = $inFile;
 | 
| 
 | 
    27 $obj{'ucn'} = $ucn; $obj{'sex'} = $sex; $obj{'ref'} = $ref;
 | 
| 
 | 
    28 $obj{'noise'} = $noise; $obj{'baq'} = $baq; 
 | 
| 
 | 
    29 
 | 
| 
 | 
    30 if($type eq "tbi"){
 | 
| 
 | 
    31 	`tabix -p vcf $inFile`;
 | 
| 
 | 
    32 }
 | 
| 
 | 
    33 
 | 
| 
 | 
    34 
 | 
| 
 | 
    35 if($hg ne "none"){
 | 
| 
 | 
    36 	$obj{'hg'} = $hg;
 | 
| 
 | 
    37 }
 | 
| 
 | 
    38 
 | 
| 
 | 
    39 if( defined $name ){
 | 
| 
 | 
    40 	$obj{'sampleName'} = $name;
 | 
| 
 | 
    41 }
 | 
| 
 | 
    42 
 | 
| 
 | 
    43 my $genomeID = generate_id(%obj);
 | 
| 
 | 
    44 open(my $fh, '>', $outFile);
 | 
| 
 | 
    45 print $fh $genomeID;
 | 
| 
 | 
    46 close $fh;
 |