본문 바로가기

samtools4

[유전체] samtools, bedtools 이용해서 특정 부분 mapping된 fastq만들기 우선 먼저 mapping된 read만을 가져오기 위해서 아래 포스팅을 참조하세요~! https://mopipe.tistory.com/150 [유전체] samtools이용해서 mapped read만 가져오기 가장 먼저 fastq에서 alignment를 시켜줍니다. (bowtie2, bwa 등 이용해서 알아서) 그리고 sam file을 bam file로 변경시킴 (반대로 bam파일을 sam파일로 변경가능) # sam to bam samtools view -Sb [input.sam] >.. mopipe.tistory.com Target region은 chr6번을 이용하여 분석을 해보겠습니다. bwa-0.7.17 mem chr6.fa.gz SRR794684_R1.fastq.gz SRR794684_R2.fastq.. 2021. 10. 26.
[유전체] samtools 오류 해결! SEQ and QUAL are of different length samtools를 이용하여 bam 파일을 만들다 보면은 가끔 다음과 같은 에러가 발생할 수가 있습니다. # 실행 명령어 samtools view -Sb input.sam > output.bam # 뜨는 에러 [E::sam_parse1] SEQ and QUAL are of different length [W::sam_read1] Parse error at line 5387631 [main_samview] truncated file. 이럴때는 fastq에서 sam파일을 다시 돌려보시면 해결이 됩니다. 가끔 bwa를 돌릴 때 결과가 다 안 나오는 경우가 있습니다. (서버가 바쁘거나 혹은 가끔 이런일이 발생함) 2021. 8. 24.
[유전체] samtools이용해서 mapped read만 가져오기 가장 먼저 fastq에서 alignment를 시켜줍니다. (bowtie2, bwa 등 이용해서 알아서) 그리고 sam file을 bam file로 변경시킴 (반대로 bam파일을 sam파일로 변경가능) # sam to bam samtools view -Sb [input.sam] > [output.bam] # bam to sam samtools view input.bam > output.sam bam file에서 mapped read만 가져오기 위해서는 sam flags라는 것을 알아야 합니다. https://broadinstitute.github.io/picard/explain-flags.html Explain SAM Flags broadinstitute.github.io 위 사이트를 들어가시게 되면 다음.. 2021. 8. 17.
[유전체]samtools sort 에러 발생시 해결 bowtie2 이용해서 분석하는 도중에 samtools로 sort를 진행을 하면 가끔 다음과 같은 오류가 발생할 경우가 있습니다. [E::bgzf_read] Read block operation failed with error 2 after 0 of 4 bytes samtools sort: truncated file. Aborting 왜 그럴까 생각하지말고, 처음부터 fastq부터 진행을 해주시면 대부분 해결이 되었습니다. 그리고 bowtie2나 bwa의 경우 대부분 mapping되는 위치가 비슷하기 때문에 bwa도 같이 돌려 보시면서 bam파일의 크기도 체크를 해보시는 것도 방법입니다. 저렇게 에러가 난 경우는 대부분 만들어지다 만 경우가 대부분입니다. 서버에서 여러 tool을 돌릴때 가끔 메모리 부족.. 2021. 8. 17.