Skip to content

Commit

Permalink
Update to AlignmentRecordField and its usages as contig changed to co…
Browse files Browse the repository at this point in the history
…ntigName in alignmentRecord
  • Loading branch information
jpdna committed Apr 7, 2016
1 parent 47dfa4d commit 500c1cb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CalculateDepth(protected val args: CalculateDepthArgs) extends BDGSparkCom

def run(sc: SparkContext): Unit = {

val proj = Projection(contig, start, cigar, readMapped)
val proj = Projection(contigName, start, cigar, readMapped)

val adamRDD: RDD[AlignmentRecord] = sc.loadAlignments(args.adamInputPath, projection = Some(proj))
val mappedRDD = adamRDD.filter(_.getReadMapped)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class FlagStat(protected val args: FlagStatArgs) extends BDGSparkCommand[FlagSta
AlignmentRecordField.readMapped,
AlignmentRecordField.mateMapped,
AlignmentRecordField.readPaired,
AlignmentRecordField.contig,
AlignmentRecordField.mateContig,
AlignmentRecordField.contigName,
AlignmentRecordField.mateContigName,
AlignmentRecordField.primaryAlignment,
AlignmentRecordField.duplicateRead,
AlignmentRecordField.readMapped,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class FlagStatSuite extends ADAMFunSuite {
AlignmentRecordField.readMapped,
AlignmentRecordField.mateMapped,
AlignmentRecordField.readPaired,
AlignmentRecordField.contig,
AlignmentRecordField.mateContig,
AlignmentRecordField.contigName,
AlignmentRecordField.mateContigName,
AlignmentRecordField.primaryAlignment,
AlignmentRecordField.duplicateRead,
AlignmentRecordField.readMapped,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ import org.bdgenomics.formats.avro.AlignmentRecord
*/
object AlignmentRecordField extends FieldEnumeration(AlignmentRecord.SCHEMA$) {

val contig, start, end, mapq, readName, sequence, mateAlignmentStart, cigar, qual, recordGroupId, recordGroupName, readPaired, properPair, readMapped, mateMapped, readNegativeStrand, mateNegativeStrand, readInFragment, primaryAlignment, failedVendorQualityChecks, duplicateRead, mismatchingPositions, attributes, recordGroupSequencingCenter, recordGroupDescription, recordGroupRunDateEpoch, recordGroupFlowOrder, recordGroupKeySequence, recordGroupLibrary, recordGroupPredictedMedianInsertSize, recordGroupPlatform, recordGroupPlatformUnit, recordGroupSample, mateContig, origQual, supplementaryAlignment, secondaryAlignment = SchemaValue
val contigName, start, end, mapq, readName, sequence, mateAlignmentStart, cigar, qual, recordGroupId, recordGroupName, readPaired, properPair, readMapped, mateMapped, readNegativeStrand, mateNegativeStrand, readInFragment, primaryAlignment, failedVendorQualityChecks, duplicateRead, mismatchingPositions, attributes, recordGroupSequencingCenter, recordGroupDescription, recordGroupRunDateEpoch, recordGroupFlowOrder, recordGroupKeySequence, recordGroupLibrary, recordGroupPredictedMedianInsertSize, recordGroupPlatform, recordGroupPlatformUnit, recordGroupSample, mateContigName, origQual, supplementaryAlignment, secondaryAlignment = SchemaValue
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log
val projection =
if (isADAMRecord) {
Projection(
AlignmentRecordField.contig,
AlignmentRecordField.mateContig,
AlignmentRecordField.contigName,
AlignmentRecordField.mateContigName,
AlignmentRecordField.readPaired,
AlignmentRecordField.readInFragment,
AlignmentRecordField.readMapped,
Expand All @@ -216,7 +216,7 @@ class ADAMContext(@transient val sc: SparkContext) extends Serializable with Log
} else if (isADAMContig) {
Projection(NucleotideContigFragmentField.contig)
} else {
Projection(AlignmentRecordField.contig)
Projection(AlignmentRecordField.contigName)
}

if (filePath.endsWith(".bam") || filePath.endsWith(".sam")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class GenomicPositionPartitionerSuite extends ADAMFunSuite {

val p = {
import org.bdgenomics.adam.projections.AlignmentRecordField._
Projection(contig, start, readName, readMapped)
Projection(contigName, start, readName, readMapped)
}
val rdd: RDD[AlignmentRecord] = sc.loadAlignments(filename, projection = Some(p))

Expand Down

0 comments on commit 500c1cb

Please sign in to comment.