Commit 9971b045 authored by Sebastien Moretti's avatar Sebastien Moretti
Browse files

Fix to display right name for genomic seq with from-to

parent 2af3aba0
......@@ -381,7 +381,7 @@ for(my $r=0; $r<=$#original_names; $r++){
download_seq($cache, $amont, $aval, $chr);
$intronStep = 1;
unshift(@nt_GIs, "$chr-$amont-$aval");
unshift(@nt_GIs, "$chr--$amont-$aval");
}
}
}
......@@ -1016,7 +1016,7 @@ sub download_seq{
}
if ( $amont =~ /^\d+$/ && $aval =~ /^\d+$/ ){
fetch_fasta("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=$pacc2puid&rettype=fasta&retmode=text&from=$amont&to=$aval&tool=ProtoGene&email=smoretti\@unil.ch", "$cache/$acc[$a]-$from-$to.fas");
fetch_fasta("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=$pacc2puid&rettype=fasta&retmode=text&from=$amont&to=$aval&tool=ProtoGene&email=smoretti\@unil.ch", "$cache/$acc[$a]--$from-$to.fas");
}
else{
fetch_fasta("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id=$pacc2puid&rettype=fasta&retmode=text&tool=ProtoGene&email=smoretti\@unil.ch", "$cache/$acc[$a].fas");
......@@ -1024,12 +1024,12 @@ sub download_seq{
#FIXME Don't remember exactly what all this function does
my $checkSeq = '';
$checkSeq = `grep -v '>' "$cache/$acc[$a]-$from-$to.fas"` if ( $amont =~ /^\d+$/ && $aval =~ /^\d+$/ );
$checkSeq = `grep -v '>' "$cache/$acc[$a].fas"` if ( $amont !~ /^\d+$/ || $aval !~ /^\d+$/ );
$checkSeq = `grep -v '>' "$cache/$acc[$a]--$from-$to.fas"` if ( $amont =~ /^\d+$/ && $aval =~ /^\d+$/ );
$checkSeq = `grep -v '>' "$cache/$acc[$a].fas"` if ( $amont !~ /^\d+$/ || $aval !~ /^\d+$/ );
if ( $checkSeq !~ /^[A-Za-z]/ && $cp==0 ){
# if ( -s "$cache/$acc[$a]-$from-$to.fas" <120 && $cp==0){ #Instead of multiple downloads, only seq name and header
unlink("$cache/$acc[$a]-$from-$to.fas") if ( $amont =~ /^\d+$/ && $aval =~ /^\d+$/ );
unlink("$cache/$acc[$a].fas") if ( $amont !~ /^\d+$/ || $aval !~ /^\d+$/ );
# if ( -s "$cache/$acc[$a]--$from-$to.fas" <120 && $cp==0){ #Instead of multiple downloads, only seq name and header
unlink("$cache/$acc[$a]--$from-$to.fas") if ( $amont =~ /^\d+$/ && $aval =~ /^\d+$/ );
unlink("$cache/$acc[$a].fas") if ( $amont !~ /^\d+$/ || $aval !~ /^\d+$/ );
# $amont = '';
$aval = $aval - 5000 if ( $aval =~ /^\d+$/ );
$a = $a - 1;
......@@ -1231,7 +1231,7 @@ sub prepareAnnotation{
my ($best_pos) = @_;
my $bestOne = $best_pos;
$bestOne =~ s{:.+$}{} if ( $best_pos !~ /^\d+$/ );
$bestOne =~ s{--.+$}{} if ( $best_pos !~ /^\d+$/ );
if ( $bestOne =~ /^\d+$/ ){
open(my $BEST, '<', "$cache/$bestOne.fas");
FIND_BEST:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment