Commit 6342e605765fd2f5b9171c1ced4e92a19438c5e3

Authored by Luis Arturo Medrano-Soto
1 parent f03ad4a854
Exists in master

Added the option to give an input file for the full proteins to locateFragment.pl

Showing 1 changed file with 21 additions and 3 deletions Side-by-side Diff

locateFragment.pl View file @ 6342e60
... ... @@ -169,8 +169,13 @@
169 169  
170 170 my ($frag, $acc) = @_;
171 171  
  172 +
  173 +# print Data::Dumper->Dump([$frag, $acc, $accFile ], [qw(*frag *acc *accFile)]);
  174 +# exit;
  175 +
  176 +
172 177 #Sequence for full protein
173   - my $accSeq = "$outdir/${acc}.faa";
  178 + my $accSeq = (-f $accFile)? $accFile : "$outdir/${acc}.faa";
174 179  
175 180  
176 181 #Save fragment to file
... ... @@ -237,6 +242,14 @@
237 242 #Default value for output directory
238 243 $outdir = "." unless ($outdir);
239 244 system "mkdir -p $outdir" unless (-d $outdir);
  245 +
  246 + #When accession is not given, take the first part of the input file name as accession
  247 + unless ($accession) {
  248 + my @pathComp = split(/\//, $accFile);
  249 + $accession = $pathComp[-1];
  250 + $accession =~ s/(\.faa|\.fasta)$//g;
  251 + }
  252 +
240 253 }
241 254  
242 255  
... ... @@ -327,8 +340,13 @@
327 340  
328 341 Options
329 342  
330   --a, --accession {String} (Mandatory)
331   - NCBI accession of query protein
  343 +
  344 +-i, --acc-file {PATH} (Mandataory if option -a is not given)
  345 + File with the full sequence in fasta format of the proteins where the
  346 + fragment will be identified. This opeiont
  347 +
  348 +-a, --accession {String} (Mandatory if option -i is not given)
  349 + NCBI accession of query protein.
332 350  
333 351 -f, --fragment {String} (Mandatory)
334 352 Sequence fragment to locate within the full protein