Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chipathlon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Holland Computing Center
chipathlon
Commits
9b28fdc0
Commit
9b28fdc0
authored
7 years ago
by
aknecht2
Browse files
Options
Downloads
Patches
Plain Diff
Updated autodoc and rst for genome.
parent
7cf140fa
No related branches found
No related tags found
1 merge request
!25
Resolve "Method Auto Doc"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
chipathlon/genome.py
+36
-11
36 additions, 11 deletions
chipathlon/genome.py
doc/source/genome.rst
+3
-0
3 additions, 0 deletions
doc/source/genome.rst
with
39 additions
and
11 deletions
chipathlon/genome.py
+
36
−
11
View file @
9b28fdc0
...
...
@@ -3,18 +3,22 @@ import chipathlon.conf
from
Pegasus.DAX3
import
File
,
PFN
class
Genome
(
object
):
"""
:param assembly: Version of genome used for building i.e. hg19, grch38p6, mm9
:type assembly: string
:param tool: Tool used to create the genome.
:type tool: string
:param base_file: Main genome file probably a .fna or .fa file.
:type base_file: string
:param chrom_sizes: Chromsome sizes file.
:type chrom_sizes: string
The genome handles loading and validating genome files on the disk.
It servers as a helper class to make managing genome input files
much easier.
"""
def
__init__
(
self
,
assembly
,
tool
,
base_file
,
chrom_sizes
):
"""
:param assembly: Version of genome used for building i.e. hg19, grch38p6, mm9
:type assembly: string
:param tool: Tool used to create the genome.
:type tool: string
:param base_file: Main genome file probably a .fna or .fa file.
:type base_file: string
:param chrom_sizes: Chromsome sizes file.
:type chrom_sizes: string
"""
self
.
assembly
=
assembly
self
.
tool
=
tool
self
.
base_file
=
base_file
...
...
@@ -38,7 +42,7 @@ class Genome(object):
def
is_valid
(
self
):
"""
Checks if the
run
is valid.
Checks if the
genome
is valid.
"""
return
len
(
self
.
errors
)
==
0
...
...
@@ -49,18 +53,39 @@ class Genome(object):
return
"
\n
"
.
join
(
self
.
errors
)
def
get_base_file
(
self
):
"""
:returns: The full name of the base file.
"""
return
self
.
files
.
get
(
"
base_file
"
)
def
get_chrom_sizes
(
self
):
"""
:returns: The full name of the chromosome sizes file.
"""
return
self
.
files
.
get
(
"
chrom.sizes
"
)
def
get_additional_files
(
self
):
"""
:returns: A list of all additional genome indices.
For bwa returns the file names of the .amb, .ann, .bwt, .pac, and .sa
files. For bowtie2 returns the file names of the .1.bt2, .2.bt2,
.3.bt2, .4.bt2, .rev.1.bt2, and .rev.2.bt2 files.
"""
return
self
.
files
.
get
(
"
additional_files
"
)
def
get_chr_fasta_files
(
self
):
"""
:returns: A list of all individual chromsome fasta files (if they exist)
"""
return
self
.
files
.
get
(
"
chr_fasta
"
)
def
get_all_files
(
self
):
"""
:returns: A list of all files: The base file, the chromsome sizes
file, all additional genome indices, and all individual chromosme
fasta files.
"""
return
[
self
.
get_base_file
(),
self
.
get_chrom_sizes
()]
+
self
.
get_additional_files
()
+
self
.
get_chr_fasta_files
()
def
_load_prefixes
(
self
):
...
...
This diff is collapsed.
Click to expand it.
doc/source/genome.rst
+
3
−
0
View file @
9b28fdc0
Genome
==============
Genome Class
^^^^^^^^^^^^^
.. autoclass:: chipathlon.genome.Genome
:members:
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment