Skip to content

Commit

Permalink
Update docs with new template and documentation (#2078)
Browse files Browse the repository at this point in the history
* updated docs for sphinx_rtd_theme

* added python documentation for with autosummary for Sphinx

* removed unused doc stylesheet
  • Loading branch information
akmorrow13 authored and heuermh committed Nov 7, 2018
1 parent fc67969 commit 032ab3b
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 167 deletions.
15 changes: 15 additions & 0 deletions adam-python/bdgenomics/adam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
r"""
=======================
bdgenomics.adam Package
=======================
.. currentmodule:: bdgenomics.adam
ADAM's Python API wraps the ADAMContext and GenomicRDD APIs so they can be used from PySpark.
The Python API is feature complete relative to ADAM's Java API.
.. automodule:: bdgenomics.adam.adamContext
.. automodule:: bdgenomics.adam.models
.. automodule:: bdgenomics.adam.rdd
.. automodule:: bdgenomics.adam.stringency
"""
25 changes: 17 additions & 8 deletions adam-python/bdgenomics/adam/adamContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
r"""
===========
adamContext
===========
.. currentmodule:: bdgenomics.adam.adamContext
.. autosummary::
:toctree: _generate/
ADAMContext
"""

from bdgenomics.adam.rdd import AlignmentRecordRDD, \
CoverageRDD, \
Expand All @@ -35,10 +45,9 @@ class ADAMContext(object):

def __init__(self, ss):
"""
Initializes an ADAMContext using a SparkContext.
Initializes an ADAMContext using a SparkSession.
:param pyspark.context.SparkContext sc: The currently active
SparkContext.
:param ss: The currently active pyspark.context.SparkContext.
"""

self._sc = ss.sparkContext
Expand All @@ -56,9 +65,9 @@ def loadAlignments(self, filePath, stringency=STRICT):
* .fa/.fasta as FASTA format,
* .fq/.fastq as FASTQ format, and
* .ifq as interleaved FASTQ format.
If none of these match, fall back to Parquet + Avro.
For FASTA, FASTQ, and interleaved FASTQ formats, compressed files are supported
through compression codecs configured in Hadoop, which by default include .gz and .bz2,
but can include more.
Expand Down Expand Up @@ -100,13 +109,13 @@ def loadIndexedBam(self,

# translate reference regions into jvm types
javaRrs = [rr._toJava(self._jvm) for rr in viewRegions]

adamRdd = self.__jac.loadIndexedBam(filePath,
javaRrs,
_toJava(stringency, self._jvm))

return AlignmentRecordRDD(adamRdd, self._sc)


def loadCoverage(self, filePath,
stringency=STRICT):
Expand Down Expand Up @@ -137,7 +146,7 @@ def loadCoverage(self, filePath,
_toJava(stringency, self._jvm))

return CoverageRDD(adamRdd, self._sc)


def loadContigFragments(self, filePath):
"""
Expand Down
13 changes: 13 additions & 0 deletions adam-python/bdgenomics/adam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
r"""
======
models
======
.. currentmodule:: bdgenomics.adam.models
.. autosummary::
:toctree: _generate/
ReferenceRegion
"""

class ReferenceRegion:
"""
Represents a contiguous region of the reference genome.
"""

def __init__(self, referenceName, start, end):
"""
Expand Down
Loading

0 comments on commit 032ab3b

Please sign in to comment.