diff --git a/README.md b/README.md index 774e562..ad2fb05 100644 --- a/README.md +++ b/README.md @@ -136,5 +136,17 @@ Command run: cd /storage/schu/ProjectGroups/RNA/Data/RNASequencing/Novogene/NHHW162910/alignments/bams/bamsSortedByName ``` ```bash -featureCounts -Q 255 -T 6 -p -a /storage/scic/Data/External/Bioinformatics/Rat/Genomes/rn5_Mar2012/annotation/annRefSeq_rn5_20Apr2016.gtf -o /storage/schu/ProjectGroups/RNA/Data/RNASequencing/Novogene/NHHW162910/gene_counts/gene_counts.txt $(echo *.bam) +featureCounts -Q 255 -T 6 -p -a /storage/scic/Data/External/Bioinformatics/Rat/Genomes/rn5_Mar2012/annotation/annRefSeq_rn5_20Apr2016.gtf -o /storage/schu/ProjectGroups/RNA/Data/RNASequencing/Novogene/NHHW162910/gene_counts/gene_counts_130117.txt $(echo *.bam) +``` +#### Extract mapped features only +Once the counting of the features/genes is done, we extract only those which have at least one read mapped to them: + +```bash +awk -F"\t" 'OFS="\t"{if(($7+$8+$9+$10+$11+$12+$13+$14+$15+$16+$17+$18+$19+$20+$21+$22)>0){print $1,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22}}' gene_counts_130117.txt > gene_counts_130117_only_mapped.txt +``` + +Then we add a header to that file with the sample names: + +```bash +paste -d '\t' <(echo "gene_name") <(head -1 gene_counts_130117.txt.summary | cut -f2-) | cat - gene_counts_130117_only_mapped.txt > gene_counts_130117_only_mapped_with_header.txt ```