Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Matching multiple substrings of a string to arrays and printing those that matchby rarenas (Acolyte) |
on Apr 03, 2018 at 19:32 UTC ( [id://1212284]=perlquestion: print w/replies, xml ) | Need Help?? |
rarenas has asked for the wisdom of the Perl Monks concerning the following question: Good evening wise monks, I wrote this perl script to help filter out the raw data from a Pubmed article reader (called ppaxe, by Sergio Castillo). Basically, ppaxe reads for me thousands of articles on Pubmed and searches for possible interactions between proteins/genes. I end up with verbs that do not actually indicate an interaction or lines with multiple verbs, of which some of those verbs do and others do not. My perl script basically needs to filter out any line that does not have a verb that indicates an interaction. I have a file of approved verbs, a file of discarded verbs and my ppaxe results file. I put my verb lists into arrays and used index instead of exists function for matching. I am not allowed to use regex so that the next generation that takes over can understand the program better. When I run my perl program it just ends up printing the whole data file without actually filtering. Can anyone help me in correcting my program and teaching me what I am doing wrong? Thanks so much,
These files are small test versions: approved_verbs_test:
discarded_verbs_test:
sample_ppaxe_data:
Desired outcome:
Back to
Seekers of Perl Wisdom
|
|