1 |
#!/bin/tcsh -f |
2 |
if ("x"$1 == "x-h") then |
3 |
echo "Usage: gffcount [-g] <gff3_file>" |
4 |
echo " Show the count of distinct mRNA names." |
5 |
echo " use -g option to count distinct gene names only (Name attribute)" |
6 |
exit 1 |
7 |
endif |
8 |
if ("x"$1 == "x-g") then |
9 |
shift |
10 |
perl -ne 'chomp;@t=split(/\t/);print "$1\n" if $t[2]=~m/gene$/ && m/ID=([^;]+)/' $1 | sort -u | wc -l |
11 |
exit |
12 |
endif |
13 |
|
14 |
if ("x"$1 == "x-l") then |
15 |
shift |
16 |
perl -ne 'chomp;@t=split(/\t/);print "$1\n" if ($t[2]!~m/(?:exon|CDS|gene)$/) && m/ID=([^;]+)/' $1 | sort -u |
17 |
exit |
18 |
endif |
19 |
|
20 |
perl -ne 'chomp;@t=split(/\t/);print "$1\n" if ($t[2]!~m/(?:exon|CDS|gene)$/) && m/ID=([^;]+)/' $1 | sort -u | wc -l |