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

error on ReaderAnalyser.py #1

Open
marlenegallet opened this issue Dec 2, 2024 · 10 comments
Open

error on ReaderAnalyser.py #1

marlenegallet opened this issue Dec 2, 2024 · 10 comments
Assignees

Comments

@marlenegallet
Copy link

Hi @BraunThomas,

I tried to use StraglrOn but I have some issues. I'm not sure that I use your addon correctly.
Here the command lines I used:
python straglron.py -o /path/output_directory --hist --score /path/straglr.bed /path/straglr.tsv /path/loci.bed

Is it correct?

Here is the following response:
Traceback (most recent call last):
File "/opt/StraglrOn-0.2.2/src/straglron.py", line 136, in
main()
File "/opt/StraglrOn-0.2.2/src/straglron.py", line 111, in main
loci_dict = ra.lociBedReader(args.loci_file)
File "/opt/StraglrOn-0.2.2/src/utils/ReaderAnalyser.py", line 130, in lociBedReader
key = locus[header.index("chr")] + ":" + locus[header.index("start")] + "-" + locus[header.index("end")]
ValueError: 'chr' is not in list

I checked all the headers in bed files are valides. could you help me?

why is there a ReaderAnalyser - Kopie.py ?

I would appreciate it if there is any tips to fix it.
Thank you!

@leonschuetz
Copy link
Collaborator

Hi @marlenegallet,

can you post the first few lines of your loci file?
It seems that the header line doesn't match the expected format.

(The ReaderAnalyser - Kopie.py file was a backup from an old version and is removed now)

Best,
Leon

@marlenegallet
Copy link
Author

Hi @leonschuetz,
Thanks for your answer.
I used 2 files, colonnes are separated with \t
1.
chr start end target_repeat associated_disorder ref_size normal_range pathogenic_range
chr19 45770204 45770266 CAG Steiner 50 50 NA

chr start end target_repeat
chr19 45770204 45770266 CAG

Best regards,
Marlene

@leonschuetz
Copy link
Collaborator

Hi @marlenegallet,

the header line has to start with #. Try to add this then it should work.

Best,
Leon

@marlenegallet
Copy link
Author

Hi @leonschuetz

Could you sent a template.bed because I has a new error:

['chr', 'start', 'end']
Traceback (most recent call last):
File "/opt/StraglrOn-0.2.2/src/straglron.py", line 136, in
main()
File "/opt/StraglrOn-0.2.2/src/straglron.py", line 111, in main
loci_dict = ra.lociBedReader(args.loci_file)
File "/opt/StraglrOn-0.2.2/src/utils/ReaderAnalyser.py", line 131, in lociBedReader
new_object = Locus(locus[header.index("repeat_id")], locus[header.index("chr")], locus[header.index("start")], locus[header.index("end")],
ValueError: 'repeat_id' is not in list

Thanks a lot for your help
Marlene

@leonschuetz
Copy link
Collaborator

Hi @marlenegallet,

that's the file we use:
straglr_variant_catalog_grch38.bed

Best,
Leon

@marlenegallet
Copy link
Author

Hi @leonschuetz,

Thanks for your .bed.
I still have error message following:
['chr', 'start', 'end', 'repeat_motif', 'repeat_id', 'repeat_type', 'ref_size', 'ref_motif']
Traceback (most recent call last):
File "/opt/StraglrOn-0.2.2/src/straglron.py", line 136, in
main()
File "/opt/StraglrOn-0.2.2/src/straglron.py", line 112, in main
expansions = ra.resultBedReader(args.path_input_bed, loci_dict)
File "/opt/StraglrOn-0.2.2/src/utils/ReaderAnalyser.py", line 28, in resultBedReader
if straglr[14].strip() == "":
IndexError: list index out of range

Thanks for your help

@leonschuetz
Copy link
Collaborator

Hi @marlenegallet,

the straglr input file has to cotain the following columns:
- chrom
- start
- end
- repeat_unit
- allele1:size
- allele1:copy_number
- allele1:support
- allele2:size
- allele2:copy_number
- allele2:support
- repeat_id
- repeat_type
- ref_size
- ref_motif
- min_pathogenic

It seems that the last column is missing in your file.

Best,
Leon

@marlenegallet
Copy link
Author

Hi @leonschuetz,

That's correct, straglr ouput doesn't not contain these columns. Just to be sure, to use straglrOn, it's necessary to use .bed and .tsv generated from straglr.py. So it is necessary to modify the straglr.bed?
Here the headers of .bed and .tsv:
bed (10 col)
#chrom start end repeat_unit allele1:size allele1:copy_number allele1:support allele2:size allele2:copy_number allele2:support
tsv (15 col)
#chrom start end target_repeat locus coverage genotype read_name actual_repeat copy_number size read_start strand allele read_status

Thanks for your help
Marlene

@leonschuetz
Copy link
Collaborator

Hi @marlenegallet,

the .tsv file remains unchanged, but for the .bed file you have to annotate the last columns.
(StraglrOn was designed to work with megSAP and there these columns are added)

Best,
Leon

@marlenegallet
Copy link
Author

Thanks a lot for the precision,
Best,
Marlene

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants