shabird has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks! i have a file that look like this:
LOCUS PPI3_SYNY3 379 aa linear BCT 1 +3-NOV-2019 DEFINITION RecName: Full=Putative thylakoid lumen peptidyl-prolyl cis +-trans isomerase sll0408; Short=Putative thylakoid lumen PPIase; +AltName: Full=Putative thylakoid lumen rotamase; Flags: Precursor. ACCESSION Q55118 VERSION Q55118.2 REFERENCE 1 (residues 1 to 379) AUTHORS Kaneko,T., Sato,S., Kotani,H., Tanaka,A., Asamizu,E., Naka +mura,Y., Miyajima,N., Hirosawa,M., Sugiura,M., Sasamoto,S., Kimura, +T., Hosouchi,T., Matsuno,A., Muraki,A., Nakazaki,N., Naruo,K., Okumura,S., Shimpo,S., Takeuchi,C., Wada,T., Watanabe,A., Yamada,M., Yasuda,M. and Tabata,S. TITLE Sequence analysis of the genome of the unicellular cyano +bacterium Synechocystis sp. strain PCC6803. II. Sequence determinati +on of the entire genome and assignment of potential protein-coding r +egions JOURNAL DNA Res. 3 (3), 109-136 (1996) PUBMED 8905231 REMARK NUCLEOTIDE SEQUENCE [LARGE SCALE GENOMIC DNA].; STRAIN=PCC 6803 / Kazusa REFERENCE 2 (residues 1 to 379)
I want to extract only these information from the file "PPI3_SYNY3 " , "Putative thylakoid lumen peptidyl-prolyl cis-trans isomerase sll0408" and "Sequence analysis of the genome of the unicellular cyanobacterium Synechocystis sp. strain PCC6803. II. Sequence determination of the entire genome and assignment of potential protein-coding regions" Here is my code where i am only able to extract the locus id from the file please help me here
open(GENBANK, "/Users/ale/Desktop/seq.gp.txt") or die; # Opening file results.txt in write mode with the help of ">" operator +. open (FH, ">", "results.txt"); my $content = join("", <GENBANK>); close(GENBANK); $content =~ /LOCUS\s+([A-Z0-9_]+)/; my $locus = $1; $content =~ /DEFINITION\s+(\w+\W+); my $acids = $1 ; $content =~ /TITLE([a-z0-9+\s]+)/; my $aminoAcids = uc($1); print(FH "$locus\n$acids\n$aminoAcids\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: advance Regex
by hippo (Archbishop) on Apr 28, 2020 at 12:49 UTC | |
by shabird (Sexton) on Apr 28, 2020 at 13:01 UTC | |
by hippo (Archbishop) on Apr 28, 2020 at 13:15 UTC | |
by shabird (Sexton) on Apr 28, 2020 at 13:32 UTC |