[Bioperl-l] Perl parsing

Fields, Christopher J cjfields at illinois.edu
Fri Dec 9 20:37:48 UTC 2011


On Dec 7, 2011, at 10:47 PM, lumos lumos wrote:

> Hello,
> 
> I have a text file(tab-delim) with some gene names as shown below.
> 
> *BRCA1: breast cancer 1, early onset
> 
> TNF: tumor necrosis factor
> 
> OMG: oligodendrocyte myelin glycoprotein*
> 
> I would like to get the list of gene name BRCA1,TNF,OMG that is before the
> colon(:) .
> How do I parse in perl this text file with this list of genes?

'Very carefully?'

Okay, I'll try to refrain from further sarcasm, but I'm confused, what does this have to do with BioPerl (*the toolkit*) specifically?  That is what this mailing list is for.  

Just to note, this is a very common perl task. The answer is attainable by searching for it (not to mention taking the time to learn basic perl).  For instance:

   http://stackoverflow.com/questions/4500407/in-perl-how-can-i-correctly-parse-tab-space-delimited-files-with-quoted-strings

One of the many links found by simply using Google:

   http://lmgtfy.com/?q=perl+parse+tab+file

I'll leave the regex munging to you.  

(okay, I failed at refraining from sarcasm, ah well it's friday).

chris


> Thanks in advance.
> LM






More information about the Bioperl-l mailing list