Dear all,
I would like filter out the row which have correspondence 0 counts in all samples of my count metrics. Then also would like to add some integers (pseudo counts) in remaining columns. This is the counts from htseq and II merged into big count metrics. The main problem is that I have about 36 columns+ 1 id and I cant wrap this code what i have done for 6 samples for my another project.
cat merged.htseq | \
awk -F "\t" '{
if ($2>0 || $3>0 || $4>0 || $5>0 || $6>0 || $7>0 )
print $1"\t"$2+1"\t" $3+1"\t"$4+1"\t"$5+1"\t"$6+1"\t"$7+1"\t"
}' > final_matrix_nonzero_1pseudoCounts.txt
for example:
id c1 c2 c3 t1 t2 t3
gene1 0 0 1 0 0 1
gene2 0 0 0 0 0 0 #(should be removed; gene 2 rows; because all columns have 0 in all sample)
gene3 1 1 23 45 5 0
then add 1 in remaining matrix (final matrix)
id c1 c2 c3 t1 t2 t3
gene1 1 1 2 1 1 2
gene3 2 2 24 46 6 1
Thanks for help
Thank you so much but II have ID in my column and getting error:
maybe try