Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BED annotation when start = 0 and chr10 & 20 #266

Open
jomoxi opened this issue Dec 18, 2024 · 5 comments
Open

BED annotation when start = 0 and chr10 & 20 #266

jomoxi opened this issue Dec 18, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@jomoxi
Copy link

jomoxi commented Dec 18, 2024

Dear

Thanks for this great piece of work
I've an issue to report: when you try to annotate a BED file, it gets crazy results when start = 0 and chromosome ends with 0 (chr10, 20)

For example, this is the input BED

chr1	0	1000	DEL	SAMPLE_A
chr2	2	2000	DUP	SAMPLE_A
chr10	0	1000	DUP	SAMPLE_A
chr10	1	1000	DEL	SAMPLE_A
chr11	0	1000	DEL	SAMPLE_A
chr20	0	2000	DEL	SAMPLE_A
chr22	1000	2000	DUP	SAMPLE_A

Then we run annotsv (v3.4.4) as follows:

AnnotSV \
-annotationMode full \
-SVinputFile test.cnv.bed \
-genomeBuild GRCh38 \
-outputDir . \
-outputFile test \
-annotationsDir ANNOTSV/3.4.4/ \
-svtBEDcol 4 \
-samplesidBEDcol 5

The resulting tsv looks like this

AnnotSV_ID	SV_chrom	SV_start	SV_end	SV_length	SV_type
1_1_1000_DEL_1	1	1	1000	-999	DEL
10_1_1000_DUP_1	11	0	1000	999	DUP
10_2_1000_DEL_1	10	2	1000	-998	DEL
11_1_1000_DEL_1	11	1	1000	-999	DEL
2_3_2000_DUP_1	3	2	2000	1997	DUP
20_1_2000_DEL_1	21	0	2000	-1999	DEL
22_1001_2000_DUP_1	22	1001	2000	999	DUP

As you can see, there's is no problem with 0-start position except when the chromosome is 10 or 20. Then it sums +1 to the chromosome number and doesn't update start position to 1. It can result in a big mess..

Many thanks in advance!

@lgmgeo
Copy link
Owner

lgmgeo commented Dec 19, 2024

So strange. Thank you for the report!

@lgmgeo
Copy link
Owner

lgmgeo commented Dec 19, 2024

Ok, this is a stupid glitch.
Sorry, our servers are down at the moment. I can't push a new version.

Can you edit the file $ANNOTS/share/tcl/AnnotSV/AnnotSV-write.tcl?
The error is line 57 (in the # Formate "SV_start" section). You need to add the "+1" like this:

set lengthTot [expr {$length_updated_AnnotSV_ID+$length_chrom+1}]

Really sorry for the inconvenience.

@jomoxi
Copy link
Author

jomoxi commented Dec 20, 2024

Thanks for the quick response!

Now it works properly. This is the output:

AnnotSV_ID	SV_chrom	SV_start	SV_end
1_1_1000_DEL_1	1	1	1000
10_1_1000_DUP_1	10	1	1000
10_2_1000_DEL_1	10	2	1000
11_1_1000_DEL_1	11	1	1000
2_3_2000_DUP_1	2	3	2000
20_1_2000_DEL_1	20	1	2000
22_1001_2000_DUP_1	22	1001	2000

Bonnes fêtes!

@lgmgeo
Copy link
Owner

lgmgeo commented Dec 20, 2024

Great!
Thanks again for the report.

Et bonnes fêtes également ;o)

@lgmgeo lgmgeo added the bug Something isn't working label Dec 20, 2024
@lgmgeo
Copy link
Owner

lgmgeo commented Dec 20, 2024

I just added the fix in the patch_AnnotSV branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants