Uploaded by pb

bam-bedgraph-bigwig

advertisement
1. bam sorting
samtools sort [email protected] 12 -o sort.bam
2. make bedgraph
STAR --runMode inputAlignmentsFromBAM --runThreadN 12 --inputBAMfile sort.bam --outWigType bedGraph -outWigStrand Stranded --outWigNorm RPM --outFileNamePrefix pref
→ change the str1 output positive values to negative values
conversion python code
import sys
with open(sys.argv[1],'r') as f :
out = open("minus.FT3_7_Signal.UniqueMultiple.str1.out.bg","w")
for i in f :
i.rstrip("\n")
ls = i.split("\t")
ls[3] = -float(ls[3])
print(ls[0],"\t",ls[1],"\t",ls[2],"\t",ls[3],file=out)
out.close()
3. make bigwig
bedGraphToBigWig bedgraph/str2.bg /data/Reference/GRCh38/star_index/chrNameLength.txt bigwig/str2.bigwig
bedGraphToBigWig bedgraph/minus.str1.bg /data/Reference/GRCh38/star_index/chrNameLength.txt bigwig/str1.bigwig
* created by reference indexing
→ move bigwig file to IGV ➔ visualization
* str1 = * str2 = +
** Which of the unique and unique multiple of the bedgraph output is your choice
Download