Closed michieitel closed 6 years ago
In fact. It seems samclip does not spit out a regular .sam bam but a text file ...
SAM files are text files.
The documentationc clearly shows you need the -h option for view:
# the -h is to emsure the SAM header is included
% samtools view -h in.bam | samclip --ref ref.fa | samtools sort > out.bam
Dear Torsten,
I was trying your script on a bam file that I produced by mapping nanopore reads to a reference assembly. It turns out that your scripts outputs a sam file without sam header.
These are the commands I used: minimap2 -t 40 -ax map-ont reference.fasta nanopore_reads_raw.fastq.gz | samtools view -S -bT reference.fasta - > nanopore_reads_minimap2_mapped.bam
samtools faidx reference.fasta
samtools view nanopore_reads_minimap2_mapped.bam | samclip --max 40 --ref reference.fasta > nanopore_reads_minimap2_mapped_filtered.sam
Did I do sth wrong?
Thanks Michael