Skip to content

error: list index out of range #44

Description

@xhuashen

Dear developers,
when I run EnsembleTR to merge TR calls from different TRcallers, I encounter a error like
Traceback (most recent call last):
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/bin/EnsembleTR", line 8, in
sys.exit(run())
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/main.py", line 80, in run
retcode = main(args)
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/main.py", line 46, in main
recresolver = recordcluster.RecordResolver(rc)
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/recordcluster.py", line 528, in init
self.rc_graph = ClusterGraph(rc)
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/recordcluster.py", line 440, in init
self.graph = self.BuildGraph()
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/recordcluster.py", line 454, in BuildGraph
allele_list = self.GetAlleleList()
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/recordcluster.py", line 482, in GetAlleleList
allele = Allele(ro, al_idx)
File "/qitinglab/shenlongxin/cache/conda/envs/EnsembleTR/lib/python3.8/site-packages/ensembletr/recordcluster.py", line 330, in init
self.allele_sequence = ro.prepend_seq + alleles[al_idx] + ro.append_seq
IndexError: list index out of range
my code is
EnsembleTR
--ref ${ref_fa}
--out ${EnsembleTR_dir}/EnsembleTR_merge.chr${CHR}.vcf
--vcfs ${GangSTR},${ExpansionHunter},${HipSTR},${adVNTR}
I utilized call level and locus level filter prior to EnsembleTR, like this

call level filter

for GangSTR add more

basename=$(basename "${GangSTR_vcf}" .vcf.gz)
dumpSTR --vcf ${GangSTR_vcf} --out ${out_dir}/GangSTR/${basename}
--gangstr-min-call-DP 10 --gangstr-max-call-DP 1000 --gangstr-filter-spanbound-only --gangstr-filter-badCI --gangstr-min-call-Q 0.90

For ExpansionHunter

basename=$(basename "${ExpansionHunter_vcf}" .vcf.gz)
dumpSTR --vcf ${ExpansionHunter_vcf} --out ${out_dir}/ExpansionHunter/${basename}
--eh-min-call-LC 10 --eh-max-call-LC 1000

For HipSTR

basename=$(basename "${HipSTR_vcf}" .vcf.gz)
dumpSTR --vcf ${HipSTR_vcf} --out ${out_dir}/HipSTR/${basename}
--hipstr-min-call-Q 0.9 --hipstr-max-call-flank-indel 0.15 --hipstr-max-call-stutter 0.15 --hipstr-min-call-DP 10 --hipstr-max-call-DP 1000

adVNTR

basename=$(basename "${adVNTR_vcf}" .vcf.gz)
dumpSTR --vcf ${adVNTR_vcf} --out ${out_dir}/adVNTR/${basename}
--advntr-min-call-DP 10 --advntr-min-spanning 2 --advntr-min-flanking 2

locus level filter

conda activate flair
tools_list=('GangSTR' 'HipSTR')
work_dir=/qitinglab/shenlongxin/Fetal_GTEx/01_TR_Genotyping/STR_res/merge_vcf
cd ${work_dir}
tool=${tools_list[$SLURM_ARRAY_TASK_ID]}
bcftools sort -Oz -o ${work_dir}/${tool}_merge.sorted.vcf.gz ${work_dir}/${tool}_merge.vcf
tabix -p vcf ${work_dir}/${tool}_merge.sorted.vcf.gz
conda deactivate
conda activate EnsembleTR
dumpSTR --vcf ${work_dir}/${tool}_merge.sorted.vcf.gz --out ${tool}_merge.filter.vcf --min-locus-callrate 0.8 --min-locus-hwep 0.000001 --filter-regions /qitinglab/shenlongxin/Fetal_GTEx/01_TR_Genotyping/hg38_segdup.sorted.bed.gz --filter-regions-names SEGDUP
conda deactivate
conda activate flair
bcftools view -f PASS ${tool}_merge.filter.vcf | bcftools sort -Oz -o ${tool}_merge.filter.sorted.PASS.vcf.gz
tabix -p vcf ${tool}_merge.filter.sorted.PASS.vcf.gz

What suggestions can you give me to identify what errors occurred during the process? I look forward to and greatly appreciate your reply.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions