abyzovlab / CNVpytor

a python extension of CNVnator -- a tool for CNV analysis from depth-of-coverage by mapped reads
MIT License
179 stars 26 forks source link

In filtration, I got error!! #150

Open hayeon-pak opened 1 year ago

hayeon-pak commented 1 year ago

When I tried below process,

cnvpytor \ -root $out_root \ -view 100 <<ENDL

set Q0_range -1 0.5 set p_N 0 0.5 set size_range 300 inf print calls set print_filename dir/to/${sample_id}_hg19.100}.vcf set annotate print calls quit ENDL

I got this error

Traceback (most recent call last):

File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connection.py", line 158, in _new_conn """ File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/util/connection.py", line 80, in create_connection

File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/util/connection.py", line 70, in create_connection ) TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 597, in urlopen If specified, overrides the default timeout for this one File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 343, in _make_request

File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn response.drain_conn() File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connection.py", line 301, in connect key_file=None, File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connection.py", line 167, in _new_conn if self.source_address: urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fb154528220>: Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/dir/to/miniconda3/lib/python3.8/site-packages/requests/adapters.py", line 440, in send resp = conn.urlopen( File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 637, in urlopen if not isinstance(retries, Retry): File "/dir/to/miniconda3/lib/python3.8/site-packages/urllib3/util/retry.py", line 398, in increment

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='grch37.rest.ensembl.org', port=443): Max retries exceeded with url: /overlap/region/human/chr5:70551101-70559600?content-type=application/json;feature=gene; (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb154528220>: Failed to establish a new connection: [Errno 110] Connection timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/dir/to/miniconda3/bin/cnvpytor", line 8, in sys.exit(main()) File "/dir/to/miniconda3/lib/python3.8/site-packages/cnvpytor/main.py", line 303, in main view.prompt() File "/dir/to/miniconda3/lib/python3.8/site-packages/cnvpytor/viewer.py", line 501, in prompt self.print_calls_file() File "/dir/to/miniconda3/lib/python3.8/site-packages/cnvpytor/viewer.py", line 997, in print_calls_file calls = self.get_calls() File "/dir/to/miniconda3/lib/python3.8/site-packages/cnvpytor/viewer.py", line 954, in get_calls row.append(annotator.get_info("%s:%d-%d" % (c, call["start"], call["end"]))) File "/dir/to/miniconda3/lib/python3.8/site-packages/cnvpytor/annotator.py", line 50, in get_info response = requests.get(self.url_template.format(region=region)) File "/dir/to/miniconda3/lib/python3.8/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, kwargs) File "/dir/to/miniconda3/lib/python3.8/site-packages/requests/api.py", line 61, in request return session.request(method=method, url=url, kwargs) File "/dir/to/miniconda3/lib/python3.8/site-packages/requests/sessions.py", line 529, in request resp = self.send(prep, send_kwargs) File "/dir/to/miniconda3/lib/python3.8/site-packages/requests/sessions.py", line 645, in send r = adapter.send(request, kwargs) File "/dir/to/miniconda3/lib/python3.8/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='grch37.rest.ensembl.org', port=443): Max retries exceeded with url: /overlap/region/human/chr5:70551101-70559600?content-type=application/json;feature=gene; (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb154528220>: Failed to establish a new connection: [Errno 110] Connection timed out'))

I need your help Thank you

arpanda commented 1 year ago

The error is coming from set annotate line. If you don't need the annotation of the region, you may remove that line from your command. We try to annotate the genomic regions using ensemble api and somehow it causing the issue.

Thank You Arijit

zainabae commented 1 year ago

The error is coming from set annotate line. If you don't need the annotation of the region, you may remove that line from your command.

We try to annotate the genomic regions using ensemble api and somehow it causing the issue.

Thank You

Arijit

Hello @arpanda Is there anyway to fix this issue of annotation? I want to annotate CNV regions in CamDro3 genome, and I'm getting the same error.

arpanda commented 1 year ago

We use Ensembl REST API to annotate the regions. Currently, hg19 and hg38 reference genome is configured for it. Sometime, the issue occurs when too many regions are called. If your reference genome is not human (hg19 and hg38), the error is due to missing ensembl api configuration. I will add a error log to let the user know.

I am not sure if Ensembl has any rest api url for CamDro3 genome or not. If you have any such url please add that url in your genome configuration file. You may look at the default genome configuration for hg19 and and hg38. This is ensembl api configuration for hg19 genome.

"ensembl_api_region": "https://grch37.rest.ensembl.org/overlap/region/human/{region}?content-type=application/json;feature=gene;"

source: genome.py

Thank You Arijit