Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
akmorrow13 committed Jan 29, 2018
1 parent 32a7de7 commit 37e09d4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,6 @@ object ReferenceRegion {
}
}

/**
* Builds a referenceRegion from genomic coordinates.
*
* @param referenceName reference name
* @param start start position
* @param end end position
* @return Reference Region for these genomic coordinates
*/
def fromGenomicRange(referenceName: String, start: Long, end: Long): ReferenceRegion = {
ReferenceRegion(referenceName, start, end)
}

/**
* Builds a reference region for a called genotype.
*
Expand All @@ -214,6 +202,18 @@ object ReferenceRegion {
ReferenceRegion(variant.getContigName, variant.getStart, variant.getEnd)
}

/**
* Builds a referenceRegion from genomic coordinates.
*
* @param referenceName reference name
* @param start start position
* @param end end position
* @return Reference Region for these genomic coordinates
*/
def fromGenomicRange(referenceName: String, start: Long, end: Long): ReferenceRegion = {
ReferenceRegion(referenceName, start, end)
}

private def checkRead(record: AlignmentRecord) {
require(record.getReadMapped,
"Cannot build reference region for unmapped read %s.".format(record))
Expand Down
6 changes: 3 additions & 3 deletions adam-python/bdgenomics/adam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class ReferenceRegion():

def __init__(self, chr, start, end):
def __init__(self, referenceName, start, end):
"""
Represents a contiguous region of the reference genome.
Expand All @@ -29,7 +29,7 @@ def __init__(self, chr, start, end):
half-open interval.
"""

self.chr = chr
self.referenceName = referenceName
self.start = start
self.end = end

Expand All @@ -43,4 +43,4 @@ def _toJava(self, jvm):
:param jvm: Py4j JVM handle.
"""

return jvm.org.bdgenomics.adam.models.ReferenceRegion.fromGenomicRange(self.chr, self.start, self.end)
return jvm.org.bdgenomics.adam.models.ReferenceRegion.fromGenomicRange(self.referenceName, self.start, self.end)
6 changes: 1 addition & 5 deletions adam-python/bdgenomics/adam/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import logging

from py4j.java_gateway import get_java_class
from py4j.java_collections import JavaIterator
from pyspark.rdd import RDD
from pyspark.sql import DataFrame, SQLContext

Expand Down Expand Up @@ -94,10 +93,7 @@ def filterByOverlappingRegions(self, querys):

# translate reference regions into iterator of jvm types
javaRrs = iter([q._toJava(self.sc._jvm) for q in querys])
print("!!!!!!!!!!!!!!!!JAVA RRs!!!!!!!!!!!!!!")
print(javaRrs)
print(type(javaRrs))


return self._replaceRdd(self._jvmRdd.filterByOverlappingRegions(javaRrs))

def union(self, rdds):
Expand Down
3 changes: 1 addition & 2 deletions adam-python/bdgenomics/adam/test/coverageRdd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def test_save(self):
coverage.save(tmpPath,
asSingleFile=True,
disableFastConcat=True)
print(os.listdir(tmpPath))
assert(os.listdir(tmpPath) != [])
assert(os.listdir(tmpPath) != [])


def test_collapse(self):
Expand Down
6 changes: 6 additions & 0 deletions scripts/jenkins-test
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ then
exit 1
fi

# if those pass, build the distribution package and the integration tests
mvn -U \
test \
-P coverage,coveralls scoverage:report coveralls:report \
-DrepoToken=${COVERALLS_REPO_TOKEN} ${COVERALLS_PRB_OPTION}

# make verbose again
set -x -v

Expand Down

0 comments on commit 37e09d4

Please sign in to comment.