Skip to content

Commit

Permalink
Added counting postprocessing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
MPIBR-unzued committed Jan 18, 2017
1 parent 0999d24 commit a8b2ba6
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit a8b2ba6

Please sign in to comment.