-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f6a458
commit 0530da0
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Chrom,Gene,Pos,Ref,Mut,Description,Example,Library,Platform,Analysis,Lineage,Submitter,Date | ||
NC_045512,ORFa,26158,G,A,Some human readable description,NA,NA,NA,NA,NA,YourName - YourAffiliation,YYYYMMDD | ||
NC_045512,ORFa,cow,G,A,Some human readable description,NA,NA,NA,NA,NA,Roy Kent - AFC Richmond,20210905 | ||
NC_045512,ORF1a,7243,G,A,Some human readable description,NA,NA,NA,NA,NA,Josef Martinez - ATLUTD,20210905 | ||
NC_045512,ORF1a,70243,G,A,Some human readable description,NA,NA,NA,NA,NA,George Bello - ATLUTD,20210905 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/perl -w | ||
use strict; | ||
use Getopt::Long; | ||
use File::Basename; | ||
use Scalar::Util qw(looks_like_number); | ||
|
||
# Adds submitted mutations to existing table | ||
# M. Weigand - CDC | ||
# 20210901 | ||
|
||
&GetOptions( 'indir=s' => \my$indir, | ||
'now=s' => \my$now, | ||
'latest=s' => \my$latest, | ||
'log=s' => \my$log, | ||
'out=s' => \my$out); | ||
|
||
my@new = glob("$indir/[!mut_template]*csv"); | ||
open(my $fh, '>>', $out) or die "Could not open file '$out' $!"; | ||
open(my $lg, '>>', $log) or die "Could not open file '$log' $!"; | ||
|
||
foreach my$n (@new){ | ||
open IN, "$n"; | ||
while( my$i = <IN> ){ | ||
unless($i =~ m/^Chrom/){ | ||
chomp$i; | ||
if( &REQ($i) eq "pass"){ | ||
print $fh "$i\n"; | ||
print $lg basename($n,'.csv').": $i\n"; | ||
}else{ | ||
print "ERROR IN SUBMISSION: \'$i\' \n"; | ||
} | ||
} | ||
} | ||
close IN; | ||
|
||
} | ||
close $fh; | ||
close $lg; | ||
|
||
|
||
#### | ||
sub REQ { | ||
my@mut = split(",", $_[0]); | ||
if(grep { $_ eq 'NA'} @mut[0..5]){ | ||
return("fail"); | ||
}elsif($mut[-2] =~ /YourName/){ | ||
return("fail"); | ||
}elsif($mut[-1] eq 'YYYYMMDD' ){ | ||
return("fail"); | ||
}elsif(!looks_like_number($mut[2])){ | ||
return("fail"); | ||
}elsif($mut[2] >= 29903){ | ||
return("fail"); | ||
}else{ | ||
return("pass"); | ||
} | ||
} | ||
|
Empty file.