Body: <p>I want to do some HLA typing, most of the tools require the bam file is aligned to primary genome without alternative read handling. From the International Genome Sample Resource project, I can get the high coverage file, but they are all aligned to primary genome with hla, decoy and alternative reads. I want to make the alternative reads into unmapped reads.</p>
  
  <p>I think about unmapping the whole file to fastq, and then realigning according to different assembly, but it's time-consuming and also costs a lot of storage, so I don't want to follow that approach.</p>
  
  <p>I also tried <a href="https://github.com/humanlongevity/HLA/blob/master/bin/get-reads-alt-unmap.sh" rel="nofollow noreferrer">this script</a>, but so far it's not working (I have all requirement packages installed).</p>
  
  <p>Any help, tool or insight for this problem is warmly welcome. </p>
  
  <p>Thank you</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-09T09:41:47.250Z
Comments.Text: hmmm are you familiar with samtools? you can convert unmapped reads on the fly (on the console) and then remap it and output a bam file
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-09T09:43:07.483Z
Comments.Text: the only thing i am not sure about where do your HLA reads go in the genome, if they are multimapping or you know that they map to a specific location, you can also do something similar to above
Comments.UserDisplayName: StupidWolf
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-09T10:17:34.427Z
Comments.Text: thank you for your comment. I'm not so familiar with samtools, actually, any answer for me is valuable. For the HLA allele, I use package like optitype and kourami, they can handle it if I can give them the correct input.
Comments.UserDisplayName: Thanh Nguyen
Tags: <phylogenetics>
Title: Unmapping Alternative reads in BAM file
ThreadText: # Unmapping Alternative reads in BAM file
  
  (Asked by: username_0 on 2020-04-09)
  
  I want to do some HLA typing, most of the tools require the bam file is aligned to primary genome without alternative read handling. From the International Genome Sample Resource project, I can get the high coverage file, but they are all aligned to primary genome with hla, decoy and alternative reads. I want to make the alternative reads into unmapped reads.
  
  I think about unmapping the whole file to fastq, and then realigning according to different assembly, but it's time-consuming and also costs a lot of storage, so I don't want to follow that approach.
  
  I also tried [this script](https://github.com/humanlongevity/HLA/blob/master/bin/get-reads-alt-unmap.sh), but so far it's not working (I have all requirement packages installed).
  
  Any help, tool or insight for this problem is warmly welcome.
  
  Thank you
  
  **Tags:** phylogenetics
  
  > **Comments:**
  > **username_1**: hmmm are you familiar with samtools? you can convert unmapped reads on the fly (on the console) and then remap it and output a bam file  
  > **username_1**: the only thing i am not sure about where do your HLA reads go in the genome, if they are multimapping or you know that they map to a specific location, you can also do something similar to above  
  > **username_0**: thank you for your comment. I'm not so familiar with samtools, actually, any answer for me is valuable. For the HLA allele, I use package like optitype and kourami, they can handle it if I can give them the correct input.  
  
  ---
  
  ## 0 answers
  
  