How is the format of the bed file for samtools ampliconclip
1
0
Entering edit mode
15 months ago
ManuelDB ▴ 110

If I use this

 apptainer exec "$samtoolspicardbwa" samtools  ampliconclip \
               --both-ends \
               --soft-clip \
               --fail \
               -b ../bed1.bed \
               "${Sample_ID}"_mapped_sorted_IRealigned.bam > "${Sample_ID}"_CLIPPED.bam

with bed1.bed like this

 chr2^I197401727^I197401751^ISF3B1_742-781_F_P5
chr2^I197401931^I197401951^ISF3B1_700-740_F_P5
chr2^I197401960^I197401984^ISF3B1_742-781_R_P5
chr2^I197402112^I197402137^ISF3B1_700-740_R_P5
chr2^I197402604^I197402622^ISF3B1_662-666_F_P5
chr2^I197402651^I197402673^ISF3B1_662-666_R_P5
chr2^I197402738^I197402764^ISF3B1_622-626_F_P5
chr2^I197402853^I197402873^ISF3B1_622-626_R_P5
chr2^I208248339^I208248363^IIDH1_R132_F_P5
chr2^I208248439^I208248464^IIDH1_R132_R_P5
chr5^I171410473^I171410497^INPM1_860_F_P5
chr5^I171410598^I171410622^INPM1_860_R_P5
chr7^I148807601^I148807622^IEZH2_19_F_P5
chr7^I148807762^I148807782^IEZH2_19_R_P5
chr7^I148809030^I148809048^IEZH2_18_F_P5
chr7^I148809160^I148809181^IEZH2_18_R_P5
chr7^I148810291^I148810310^IEZH2_17_F_P5
chr7^I148810452^I148810473^IEZH2_17_R_P5
chr7^I148811586^I148811611^IEZH2_16_F_P5
chr7^I148811777^I148811800^IEZH2_16_R_P5
chr7^I148813924^I148813943^IEZH2_15_F_P5
chr7^I148814183^I148814207^IEZH2_15_R_P5
chr7^I148814871^I148814891^IEZH2_14_F_P5
chr7^I148815048^I148815073^IEZH2_14_R_P5

there is no problem. However, if I use this

 apptainer exec "$samtoolspicardbwa" samtools  ampliconclip \
               --both-ends \
               --soft-clip \
               --fail \
               --strand \
               -b ../bed2.bed \
               "${Sample_ID}"_mapped_sorted_IRealigned.bam > "${Sample_ID}"_CLIPPED.bam

with bed2.bed exactly like this

 chr19^I33301308^I33301331^I+
chr19^I33301557^I33301577^I+
chr19^I33301579^I33301599^I-
chr19^I33301648^I33301668^I+
chr19^I33301785^I33301805^I-
chr19^I33301899^I33301919^I+
chr19^I33301927^I33301946^I-
chr19^I33302153^I33302173^I+
chr19^I33302175^I33302195^I-
chr19^I33302420^I33302440^I-

I get the error

[ampliconclip] error: bad bed file format in line 1 of ../bed2.bed. [ampliconclip] error: unable to load bed file.

From documentation "BED file entries used are chrom, chromStart, chromEnd and, optionally, strand"

What I am doing wrong?

EDIT

I have also tried this

 chr19^I33301308^I33301331^ICEBPA_05_F_P5^I+
chr19^I33301557^I33301577^ICEBPA_04_F_P5^I+
chr19^I33301579^I33301599^ICEBPA_05_R_P5^I-
chr19^I33301648^I33301668^ICEBPA_03_F_P5^I+
chr19^I33301785^I33301805^ICEBPA_04_R_P5^I-
chr19^I33301899^I33301919^ICEBPA_02_F_P5^I+
chr19^I33301927^I33301946^ICEBPA_03_R_P5^I-
chr19^I33302153^I33302173^ICEBPA_01_F_P5^I+
chr19^I33302175^I33302195^ICEBPA_02_R_P5^I-
chr19^I33302420^I33302440^ICEBPA_01_R_P5^I-

with the same error.

samtools ampliconclip • 1.2k views
ADD COMMENT
0
Entering edit mode

is it really a tabulation or the output of cat -T ? is there really a space at the first line ? what is the output of file bed2.bed

ADD REPLY
0
Entering edit mode

It is the output of cat -T to show you all columns are separated by tab.

There is not a space in the first line in my code (I made that error copying the file here)

What do you mean the output of file bed2.bed. The content of that file is the one show above with the chr19s

ADD REPLY
0
Entering edit mode

What do you mean the output of file bed2.bed.

Run the file command on the bed file https://linux.die.net/man/1/file

file bed2.bed
ADD REPLY
0
Entering edit mode

furthermore, are the chromosomes in the BAM file named 'chr19' and not '19'

ADD REPLY
2
Entering edit mode
15 months ago
rfran010 ★ 1.3k

I haven't used amplicon clip, but besides Pierre's questions, if I assume this is cat output and there's no space or file issue, then I would guess when you want to incorporate strand information it must be in standard bed format with strand in the 6th column. Usually done by adding in the "score" (5th) column, I think this could also just be a dot instead of a number.

https://genome.ucsc.edu/FAQ/FAQformat.html

chr19^I33301785^I33301805^ICEBPA_04_R_P5^I0^I-
ADD COMMENT
1
Entering edit mode

This is the correct answer! Thank you

ADD REPLY
1
Entering edit mode

Yes, you are right. Another thing I need to add the man page.

ADD REPLY

Login before adding your answer.

Traffic: 1514 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6