This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extract Go numbers

Hi,everyone I have meet some easy problems while I am confused about it at present ,I want to extract the locus names and Go numbers use the awk input file 1

pacId locusName transcriptName Pfam Panther GO

32694439 Seita.1G000300 Seita.1G000300.1 PF12906 PTHR23012,PTHR23012:SF99 GO:GO:0008270 


32697763 Seita.1G001600 Seita.1G001600.1 PF00225 PTHR24115,PTHR24115:SF480 GO:GO:0008017

The goal file2

locusName GO 

Seita.1G000300 GO:0008270 

Seita.1G001600 GO:0008017

while I use the cat file1| awk '{print $2"\t"$6}'>file2 ,it appears some errors

locusName GO 

Seita.1G000300 PTHR23012:SF99 

Seita.1G001600 PTHR24115:SF480

I know the excel software can solve it well,but I want to know use the awk to settle it.

Thanks

Alex

rna-seq

I have meet some easy problems

Then you can solve it. Try saying awk which kind file you are providing (tab separated, comma separated..etc) with -F argument and let us know the output.

while it did not work well

1 answer

the default delimiter of awk is NOT the tabulation but any number of whitespace.

If the delimiter is a tabulation, then just try cut -f 2,6.

Thank you ,It works well

so nyou can flag this answer as "accepted" (on the left)

Log in to answer this question.