Skip to content

Instantly share code, notes, and snippets.

View decodebiology's full-sized avatar
🎯
Focusing

Santhilal Subhash decodebiology

🎯
Focusing
View GitHub Profile
@decodebiology
decodebiology / CheckPhredScale.sh
Created March 22, 2017 14:37
Check the Phred Scale quality of sequencing files
#!/bin/bash
# ./CheckPhredScale.sh <FASTQ_FILE> <NUMBER OF LINES TO CHECK>
echo "Shell:";
zcat $1 | head -n $2 | awk '{if(NR%4==0) printf("%s",$0);}' | od -A n -t u1 | awk 'BEGIN{min=100;max=0;}{for(i=1;i<=NF;i++) {if($i>max) max=$i; if($i<min) min=$i;}}END{if(max<=74 && min<59) print "Phred+33"; else if(max>73 && min>=64) print "Phred+64"; else if(min>=59 && min<64 && max>73) print "Solexa+64"; else print "Unknown score encoding";}';
echo "";
echo "python:";
zcat $1 | awk 'NR % 4 == 0' | head -n $2 | python ./guess-encoding.py
@decodebiology
decodebiology / normalize_read_counts.R
Created October 24, 2020 20:21
RNA-seq read count normalization (TPM and RPKM)
#Rscript normalize_featurecounts.R counts_table.txt tpm ;
#Rscript normalize_featurecounts.R counts_table.txt rpkm ;
#Sample table###
#GeneID<TAB>sample1<TAB>sample2<TAB>sample3<TAB>Length
#Gene1<TAB>10<TAB>4<TAB>5<TAB>1500
#Gene2<TAB>20<TAB>43<TAB>60<TAB>4300