{"action":"closed","issue":{"url":"https://api.github.com/repos/morrislab/phylowgs/issues/54","repository_url":"https://api.github.com/repos/morrislab/phylowgs","labels_url":"https://api.github.com/repos/morrislab/phylowgs/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/morrislab/phylowgs/issues/54/comments","events_url":"https://api.github.com/repos/morrislab/phylowgs/issues/54/events","html_url":"https://github.com/morrislab/phylowgs/issues/54","id":223035005,"number":54,"title":"Array length error when preparing files in a multi-samples setting","user":{"login":"af8","id":16424458,"avatar_url":"https://avatars0.githubusercontent.com/u/16424458?v=3","gravatar_id":"","url":"https://api.github.com/users/af8","html_url":"https://github.com/af8","followers_url":"https://api.github.com/users/af8/followers","following_url":"https://api.github.com/users/af8/following{/other_user}","gists_url":"https://api.github.com/users/af8/gists{/gist_id}","starred_url":"https://api.github.com/users/af8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/af8/subscriptions","organizations_url":"https://api.github.com/users/af8/orgs","repos_url":"https://api.github.com/users/af8/repos","events_url":"https://api.github.com/users/af8/events{/privacy}","received_events_url":"https://api.github.com/users/af8/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-20T11:25:24Z","updated_at":"2017-05-12T10:34:03Z","closed_at":"2017-05-12T10:34:03Z","body":"\r\nHi,\r\n\r\nI have successfully run phyloWGS (commit 17c5362) on one WGS sample.\r\nI am now trying to run it in a multi-samples (two) setting.\r\n\r\nAnd when calling :\r\n```\r\npython ${PHYLOWGS}/parser/create_phylowgs_inputs.py \\\r\n--sex female \\\r\n--regions normal_and_abnormal_cn \\\r\n--cnvs NEG=TU1600E.cnvs.txt --cnvs POS=TU1600F.cnvs.txt \\\r\n--vcf-type NEG=mutect_slc --vcf-type POS=mutect_slc \\\r\nNEG=data/TU1600E.m1.snv.vcf POS=data/TU1600F.m1.snv.vcf\r\n```\r\n\r\n[`mutect_slc` is a vcf-type (and parser) I have added to fit our data]\r\n\r\nDuring the CNV preparation step, I obtain the following error :\r\n\r\n```\r\n...\r\nall_variants=8643 outside_subclonal_cn=6966 delta=1677\r\n1_560052\t[outside all regions]\r\n...\r\nX_659271\t[outside all regions]\r\nEstimated read depth: [ 48.  47.]\r\n[ 144000.  141000.]\r\nTraceback (most recent call last):\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 1356, in <module>\r\n    main()\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 1344, in main\r\n    grouper.write_cnvs(subsampled_vars, args.output_cnvs)\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 1037, in write_cnvs\r\n    for cnv in formatter.format_and_merge_cnvs(self._multisamp_cnv.load_single_abnormal_state_cnvs(), variants, self._cellularity):\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 394, in format_and_merge_cnvs\r\n    formatted = list(self._format_cnvs(cnvs, variants))\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 363, in _format_cnvs\r\n    total_reads = self._calc_total_reads(cnv['start'], cnv['end'])\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 342, in _calc_total_reads\r\n    return self._cap_cnv_D(D)\r\n  File \"/data-ddn/software/phylowgs/17c5362/parser/create_phylowgs_inputs.py\", line 354, in _cap_cnv_D\r\n    D_max = int(np.round(avg_ssms_in_tumour * self._read_depth))\r\nTypeError: only length-1 arrays can be converted to Python scalars\r\n```\r\n\r\n`self._read_depth` is an array of length 2 here and Python is not happy with the cast to int.\r\n\r\nWhat is the quick fix for this ?\r\nTaking the max of `np.round(avg_ssms_in_tumour * self._read_depth)` first ?\r\n\r\nThanks for your help,\r\nAnthony\r\n\r\n"}}
{"actor":{"display_login":"jwintersinger"}}