mRNA join(68351..68408,76646..77296) /gene="DEFB125" /product="defensin, beta 125" /note="Derived by automated computational analysis using gene prediction method: BestRefseq." /transcript_id="NM_153325.2" /db_xref="GI:76563935" /db_xref="GeneID:245938" /db_xref="HGNC:18105" CDS join(68351..68408,76646..77058) /gene="DEFB125" /note="Derived by automated computational analysis using gene prediction method: BestRefseq." /codon_start=1 /product="defensin, beta 125 preproprotein preproprotein" /protein_id="NP_697020.2" /db_xref="GI:76563936" /db_xref="CCDS:CCDS12989.2" /db_xref="GeneID:245938" /db_xref="HGNC:18105" gene 123252..126392 /gene="DEFB126" /note="Derived by automated computational analysis using gene prediction method: BestRefseq." /db_xref="GeneID:81623" /db_xref="HGNC:15900" mRNA join(123252..123327,126056..126392) /gene="DEFB126" /product="defensin, beta 126" /note="Derived by automated computational analysis using gene prediction method: BestRefseq." /transcript_id="NM_030931.2" /db_xref="GI:30061484" /db_xref="GeneID:81623" /db_xref="HGNC:15900" CDS join(123270..123327,126056..126333) /gene="DEFB126" /note="Derived by automated computational analysis using gene prediction method: BestRefseq." /codon_start=1 /product="defensin, beta 126 preproprotein preproprotein" /protein_id="NP_112193.1" /db_xref="GI:13624333" /db_xref="CCDS:CCDS12990.1" /db_xref="GeneID:81623" /db_xref="HGNC:15900" #### #!/usr/bin/perl use strict; use warnings; my $data = '/DATA/GenBankFile.gb'; # GenBank file is located at C:\DATA open INFILE, '<', $data or die "Please insert a new coin!\n"; my ( $cds, $gi, $version ); # Declaration of variables while ( ) { last if m!//$!; # Mark the end-of-file if ( /^VERSION.*\w:(\d+)/ ) { # Extract GI of the entire file $version = $1; } elsif ( /^\s*CDS\(s+\S+\n+\)*\Sdb_xref="GI:(\d+)/ ) { # Extract the protein gi $gi = $1; } elsif ( /^\s*CDS\s*(\S+)/ ) { # Extract the annotation $cds = $1; } if ( defined $cds && defined $gi && defined $version ) { # Print only when all variables are defined print "$gi\t$version\t$cds\n"; $gi = $cds = undef; # Get ready for the next loop } } close INFILE;