{"action":"created","issue":{"url":"https://api.github.com/repos/etal/cnvkit/issues/81","repository_url":"https://api.github.com/repos/etal/cnvkit","labels_url":"https://api.github.com/repos/etal/cnvkit/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/etal/cnvkit/issues/81/comments","events_url":"https://api.github.com/repos/etal/cnvkit/issues/81/events","html_url":"https://github.com/etal/cnvkit/issues/81","id":134711220,"number":81,"title":"cnvkit batch overwrites clashing samples?","user":{"login":"kyleabeauchamp","id":1900459,"avatar_url":"https://avatars.githubusercontent.com/u/1900459?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleabeauchamp","html_url":"https://github.com/kyleabeauchamp","followers_url":"https://api.github.com/users/kyleabeauchamp/followers","following_url":"https://api.github.com/users/kyleabeauchamp/following{/other_user}","gists_url":"https://api.github.com/users/kyleabeauchamp/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleabeauchamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleabeauchamp/subscriptions","organizations_url":"https://api.github.com/users/kyleabeauchamp/orgs","repos_url":"https://api.github.com/users/kyleabeauchamp/repos","events_url":"https://api.github.com/users/kyleabeauchamp/events{/privacy}","received_events_url":"https://api.github.com/users/kyleabeauchamp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/etal/cnvkit/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-18T22:11:52Z","updated_at":"2016-02-28T18:02:56Z","closed_at":"2016-02-27T00:26:00Z","body":"Suppose you have two directories of normal samples, where the filenames sometimes overlap.  \r\n\r\n```\r\n./bams1/A.bam\r\n./bams2/A.bam\r\n```\r\n\r\nWhen you call `cnvkit batch [...] --normal */*.bam --output ./out/`, cnvkit will use the base filenames for labeling the coverage files.  This means that cnvkit will overwrite outputs when base filenames are the same.  \r\n\r\nI think there are two possible solutions:\r\n\r\n1. Raise a ValueError if the base filenames are non-unique\r\n2.  Uniquify the base filenames before outputting, say by adding a numerical index.  \r\n\r\nI guess I personally prefer option (1) based on my experience with bcl2fastq, which does (2)."},"comment":{"url":"https://api.github.com/repos/etal/cnvkit/issues/comments/189915688","html_url":"https://github.com/etal/cnvkit/issues/81#issuecomment-189915688","issue_url":"https://api.github.com/repos/etal/cnvkit/issues/81","id":189915688,"user":{"login":"kyleabeauchamp","id":1900459,"avatar_url":"https://avatars.githubusercontent.com/u/1900459?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleabeauchamp","html_url":"https://github.com/kyleabeauchamp","followers_url":"https://api.github.com/users/kyleabeauchamp/followers","following_url":"https://api.github.com/users/kyleabeauchamp/following{/other_user}","gists_url":"https://api.github.com/users/kyleabeauchamp/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleabeauchamp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleabeauchamp/subscriptions","organizations_url":"https://api.github.com/users/kyleabeauchamp/orgs","repos_url":"https://api.github.com/users/kyleabeauchamp/repos","events_url":"https://api.github.com/users/kyleabeauchamp/events{/privacy}","received_events_url":"https://api.github.com/users/kyleabeauchamp/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T18:02:56Z","updated_at":"2016-02-28T18:02:56Z","body":"Thanks for the fix.  I did notice that the error is also raised if you have a sample that overlaps between your control and non-control groups.  Not a big deal, but it might surprise someone who was just globbing  their input files."}}