nica has asked for the wisdom of the Perl Monks concerning the following question:
the GeneID related to its coordinates $start = 5504 $stop = 6553 There are a lot of genes so I want to make a loop I use Perl for my code, you can see below a part of it (extracting the numbers) but it doesn't work.gene complement(<5504..>6553) /locus_tag="OT_ostta02g00030" /old_locus_tag="Ot02g00030" /db_xref="GeneID:9832574"
$infile = "GCF.gbff"; $outfile = "a1.txt"; open(IN, $infile) or die "Failed to open $infile\n"; open (OUT, ">$outfile") or die "Failed to open $outfile\n"; $n=0; while ($line = <IN>) { chomp ($line); $line =~ s/\r$//; if ( $line =~ /<\d+..>\d+/ ) { ++$n; my ($start, $stop) = ($1, $2); print OUT "$start, $stop, $header"; } } print STDERR"$n"; sub header { @geneID = split /\s+/, $start, $stop; $header = "$fastaprompt$geneID[1]"; } close (IN); close (OUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: gene location
by Fletch (Bishop) on Jun 12, 2019 at 13:44 UTC | |
by Eily (Monsignor) on Jun 12, 2019 at 13:50 UTC | |
by nica (Novice) on Jun 12, 2019 at 13:49 UTC | |
by Fletch (Bishop) on Jun 12, 2019 at 13:55 UTC | |
by nica (Novice) on Jun 12, 2019 at 14:00 UTC | |
|
Re: gene location
by betmatt (Scribe) on Jun 12, 2019 at 20:33 UTC | |
|
Re: gene location
by karlgoethebier (Abbot) on Jun 12, 2019 at 18:15 UTC |