Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ADAM to SAM conversion. #250

Merged
merged 3 commits into from
Jun 2, 2014
Merged

Conversation

fnothaft
Copy link
Member

This commit adds a conversion function for going from ADAM back to SAM or BAM. This work was done by @erictu; I've just gone ahead and rebased it on top of master, and done some small clean up. This resolves #49.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/330/

}
}

//ERIC: Why does this take forever:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, sorry. Let me clean that...

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/331/

.fold(dict)(dict + _)

// build header
val header: SAMFileHeader = createSAMHeader(refDict, readGroups)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we do this once per SAMRecord, rather than (first) collapsing all the ADAMRecords down into a SAMFileHeader and then passing that value in (calculated once) as an argument to this method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, good point. I think we do things in backwards order here... I'll fix.

@fnothaft
Copy link
Member Author

@tdanford I've just updated to generate the header before we do the record conversion.

I have also rebased, because, y'know.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/338/

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/339/

* Converts a single ADAM record into a SAM record.
*
* @param adamRecord ADAM formatted alignment record to convert.
* @param dict Reference sequence dictionary to use for conversion.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line (and the next one) are out of date.

@tdanford
Copy link
Contributor

@fnothaft I just filed a PR to your feature branch, with (what I think is) a failing test... let me know if you think that's a valid test or not, though.

@fnothaft
Copy link
Member Author

Thanks @tdanford; I believe your failing test is a valid test, and I will review and fix.

@AmplabJenkins
Copy link

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/340/

erictu and others added 2 commits May 30, 2014 13:54
Adding a round-trip test which fails (at the moment) with an NPE -- I *think* this is
related to the failure to write out the RG tags?
@fnothaft
Copy link
Member Author

@tdanford I've fixed the failing test, and have also cleaned up the other items you noted.

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/341/


import org.bdgenomics.adam.avro.ADAMRecord
import org.bdgenomics.adam.models.{
Attribute,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import

}
import org.bdgenomics.adam.rdd.ADAMContext._
import org.scalatest.FunSuite
import scala.collection.JavaConverters._
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import

@AmplabJenkins
Copy link

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/ADAM-prb/342/

*/
package org.bdgenomics.adam.util

import fi.tkk.ics.hadoop.bam.{ KeyIgnoringBAMOutputFormat, SAMFormat }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"SAMFormat" is unused.

@massie
Copy link
Member

massie commented Jun 2, 2014

I'm going to just merge this as is and then followup with a pull request to clean up our import statements.

massie added a commit that referenced this pull request Jun 2, 2014
Adding ADAM to SAM conversion.
@massie massie merged commit 178feb6 into bigdatagenomics:master Jun 2, 2014
@massie
Copy link
Member

massie commented Jun 2, 2014

Thanks, Frank!

@fnothaft fnothaft deleted the adam2sam branch July 10, 2014 13:15
@ankushreddy
Copy link

how to perform adam actions to convert from .adam file format to bam file.

@fnothaft
Copy link
Member Author

@ankushreddy you'll want to do:

./bin/adam-submit transform [<optional spark config> -- ] myFile.adam myFile.bam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ADAMRecord-->BAM converter
6 participants