Using awk to filter .gtf by FPKM
Hi,
I'm sorry if this is incredibly basic but I'm very new to working in terminal. I have a .gtf that I would like to filter based on an FPKM threshold. However, the column that contains FPKM values has these values in equations, so when I try with
awk '{if($16>0.3) print }' < file.gtf > new.file.gtf I get a blank file as output.
Is there a way around this? I've tried using quotations in my filtering step too, just in case awk '{if($16>"0.3") print but still get an empty file. Any tips would be greatly appreciated!!
• 2,669 views
•
link
1 answer
with input text (cut off is 0.25):
$ awk -F '"' '/FPKM/ { if ($8 > 0.25) print}' test.txt
chr1 StringTie transcript 3047584 3047862 1000 - . gene_id "STRG.4"; transcript_id "STRG.4.1"; cov "3.225806"; FPKM "0.275315"; TPM "0.532624";
chr1 StringTie transcript 3072676 3072886 1000 + . gene_id "STRG.6"; transcript_id "STRG.6.1"; cov "3.317536"; FPKM "0.283144"; TPM "0.547770";
• 0 views
•
link
Log in to answer this question.
Hi, you will definitely need to show some sample input and desired output. Currently, we cannot see how your data is arranged.
Thanks for letting me know Kevin!
Thanks for letting me know Kevin!
Here's an example of my data
If you just want an expression matrix, I would try Ballgown: A: Generating FPKM matrix accross all samples after stringtie