Body: <p>I am learning about vcf file formatting and have a multi-sample (&gt;300) vcf file and aim to <strong>group</strong> (take) <strong>samples with shared mutations</strong>.</p>
  <p>Can someone suggest a tool/command/script solve this problem?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T04:45:31.610Z
Comments.Text: FYI: Cross posted on biostars (https://www.biostars.org/p/358896/)
Comments.UserDisplayName: finswimmer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T04:52:37.787Z
Comments.Text: @finswimmer Cross posting on biostars is alright.
Comments.UserDisplayName: SmallChess
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T04:57:10.820Z
Comments.Text: @SmallChess I'm not against cross posting, but one should mention it, where they ask the question as well. Doing this every one can see if there is already a solution.
Comments.UserDisplayName: finswimmer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-01-17T05:19:10.907Z
Comments.Text: As I asked I am learning and asked for help :)
Comments.UserDisplayName: user3698773
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-16T16:53:47.440Z
Comments.Text: @finswimmer posted this response on Biostars `$ bcftools query -i 'GT="0/1"' -f '%CHROM\t%POS\t0/1\t%REF\t%ALT\t[%SAMPLE,]\n' input.vcf|sed 's/,$//'|awk -v OFS="\t" '{counts = split($6, samples, ","); print $1, $2, $3, counts, $4, $5, $6}' > stats_01.csv`
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-17T12:23:54.210Z
Comments.Text: I think the question needs to be much more specific for that answer to be useful for anyone else. What does 'shared mutation mean'? What does 'group' them mean? I think a small sample of the input and desired output is needed.
Comments.UserDisplayName: user438383
Tags: <r><shell>
Title: group samples based on shared mutations in a single multi samples vcf file
ThreadText: # group samples based on shared mutations in a single multi samples vcf file
  
  (Asked by: username_0 on 2019-01-17)
  
  I am learning about vcf file formatting and have a multi-sample (>300) vcf file and aim to **group** (take) **samples with shared mutations**.
  
  Can someone suggest a tool/command/script solve this problem?
  
  **Tags:** r, shell
  
  > **Comments:**
  > **username_1**: FYI: Cross posted on biostars (https://www.biostars.org/p/358896/)  
  > **username_2**: @username_1 Cross posting on biostars is alright.  
  > **username_1**: @username_2 I'm not against cross posting, but one should mention it, where they ask the question as well. Doing this every one can see if there is already a solution.  
  > **username_0**: As I asked I am learning and asked for help :)  
  > **username_3**: @username_1 posted this response on Biostars `$ bcftools query -i 'GT="0/1"' -f '%CHROM\t%POS\t0/1\t%REF\t%ALT\t[%SAMPLE,]\n' input.vcf|sed 's/,$//'|awk -v OFS="\t" '{counts = split($6, samples, ","); print $1, $2, $3, counts, $4, $5, $6}' > stats_01.csv`  
  > **username_4**: I think the question needs to be much more specific for that answer to be useful for anyone else. What does 'shared mutation mean'? What does 'group' them mean? I think a small sample of the input and desired output is needed.  
  
  ---
  
  ## 0 answers
  
  