This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to get FASTA sequences from GI number

Hey guys I need help

I need to download a large amount of FASTA sequences from a set of GI number.

Is there any script to do this??

Thank you

gi fasta

Thank you for your reply. I've already seen that post, but I'm not sure they can help me.

I have no knowledge of how to work with scripts and I think they don't totally fit my problem.

However in that page a guy posted this script

/#!/usr/bin/perl
use strict;
use warnings;
use Bio::DB::GenBank;
use Bio::SeqIO;

# get command-line arguments, or die with a usage statement
my $usage = "RetriveDataGenBank.pl Accessions_infile Fasta_outfilen";
my $infile = shift or die $usage;

my $outfile = shift or die $usage;
my $outfileformat = 'Fasta';
my $gb = Bio::DB::GenBank->new(-retrievaltype => 'tempfile' , -format => 'Fasta');
my @Acc_Numbers;

open (IN,$infile)||die;

my $line;

while ($line =[?]) {
  chomp $line;
  push (@Acc_Numbers, "'".$line."'")
}

my $seq_in = $gb->get_Stream_by_acc(@Acc_Numbers);
my $seq_out = Bio::SeqIO->new('-file' => ">$outfile",'-format' => $outfileformat); # write each entry in the input file to the output file

while (my $inseq = $seq_in->next_seq) { 
  $seq_out->write_seq($inseq);
}
exit

It seems to be fine for my problem but It gave me errors and I really don't know how to solve them

Unknown regexp modifier "/r" at prova.pl line 1, at end of line
"use" not allowed in expression at prova.pl line 1, at end of line
syntax error at prova.pl line 1, near "perl use strict"
BEGIN not safe after errors--compilation aborted at prova.pl line 1.

Hello ste.colombo!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

PS: You don't need perl, or any programming. You only need a shell and one command-line.

0 answers

No answers yet.

Log in to answer this question.