samtools sort -O 'bam' -o ./4.Sorted_Filtered_BamFile/${item}_sorted.bam ./3.Bowtie2/${item}.sam |
samtools index ./4.Sorted_Filtered_BamFile/${item}.sorted.filtered.bam
bedtools bamtobed -i ./4.Sorted_Filtered_BamFile/${item}.sorted.filtered.bam > ./4.Sorted_Filtered_BamFile/${item}.bed
bedtools genomecov -i ./4.Sorted_Filtered_BamFile/${item}.bed -split -bg -g ./0.Reference/"$Reference".chrom.sizes > ./4.Sorted_Filtered_BamFile/${item}.bg
wigToBigWig ./4.Sorted_Filtered_BamFile/${item}.bg ./0.Reference/"$Reference".chrom.sizes ./4.Sorted_Filtered_BamFile/${item}.bw
- peak 정보가 들어있는 bed file은 크기가 사실 그렇게 크지 않기 때문에 돌아가는데 얼마 시간이 걸리지 않는다.
*sh파일 만들기:
Data_Path=(/data01/epigenome/JBrowse/Glycine_max_v4/raw/peaks/DAP-seqPeaks)
RawDataFormat=.narrowPeak
List=`find "$Data_Path" -name "*""$RawDataFormat" | sed 's|.*/||'`
for i in $List;
do
/data01/epigenome/JBrowse/bin/flatfile-to-json.pl --bed "$i" --trackLabel "$i" --out Track
done
* python파일 만들기:
import glob,os, sys
outfile = open("Track.txt","w")
for sFiles in glob.glob("*.bed"):
Path = os.path.dirname(os.path.abspath(sFiles))
cmd = "/data01/epigenome/JBrowse/bin/flatfile-to-json.pl --bed %s --trackLabel %s --out Track"%(sFiles,sFiles)
line = "peaks,%s,%s,%s,,,%s,,,,,,,"%(sFiles,sFiles,"Prediction",Path+"/"+sFiles)
os.system(cmd)
outfile.write(line+"\n")
outfile.close()