_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 75 19.8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q272700 | Process.render | test | def render(template, context):
"""Wrapper to the jinja2 render method from a template file
Parameters
----------
template : str
Path to template file.
context : dict
Dictionary with kwargs context to populate the template
"""
path, filena... | python | {
"resource": ""
} |
q272701 | Process.template_str | test | def template_str(self):
"""Class property that returns a populated template string
This property allows the template of a particular process to be
dynamically generated and returned when doing ``Process.template_str``.
Returns
-------
x : str
String with the... | python | {
"resource": ""
} |
q272702 | Process.set_channels | test | def set_channels(self, **kwargs):
""" General purpose method that sets the main channels
This method will take a variable number of keyword arguments to
set the :py:attr:`Process._context` attribute with the information
on the main channels for the process. This is done by appending
... | python | {
"resource": ""
} |
q272703 | Process.update_main_forks | test | def update_main_forks(self, sink):
"""Updates the forks attribute with the sink channel destination
Parameters
----------
sink : str
Channel onto which the main input will be forked to
"""
if not self.main_forks:
self.main_forks = [self.output_c... | python | {
"resource": ""
} |
q272704 | Process.set_secondary_channel | test | def set_secondary_channel(self, source, channel_list):
""" General purpose method for setting a secondary channel
This method allows a given source channel to be forked into one or
more channels and sets those forks in the :py:attr:`Process.forks`
attribute. Both the source and the chan... | python | {
"resource": ""
} |
q272705 | Process.update_attributes | test | def update_attributes(self, attr_dict):
"""Updates the directives attribute from a dictionary object.
This will only update the directives for processes that have been
defined in the subclass.
Parameters
----------
attr_dict : dict
Dictionary containing the ... | python | {
"resource": ""
} |
q272706 | Compiler.set_compiler_channels | test | def set_compiler_channels(self, channel_list, operator="mix"):
"""General method for setting the input channels for the status process
Given a list of status channels that are gathered during the pipeline
construction, this method will automatically set the input channel
for the status ... | python | {
"resource": ""
} |
q272707 | Init.set_raw_inputs | test | def set_raw_inputs(self, raw_input):
"""Sets the main input channels of the pipeline and their forks.
The ``raw_input`` dictionary input should contain one entry for each
input type (fastq, fasta, etc). The corresponding value should be a
dictionary/json with the following key:values:
... | python | {
"resource": ""
} |
q272708 | Init.set_secondary_inputs | test | def set_secondary_inputs(self, channel_dict):
""" Adds secondary inputs to the start of the pipeline.
This channels are inserted into the pipeline file as they are
provided in the values of the argument.
Parameters
----------
channel_dict : dict
Each entry s... | python | {
"resource": ""
} |
q272709 | Init.set_extra_inputs | test | def set_extra_inputs(self, channel_dict):
"""Sets the initial definition of the extra input channels.
The ``channel_dict`` argument should contain the input type and
destination channel of each parameter (which is the key)::
channel_dict = {
"param1": {
... | python | {
"resource": ""
} |
q272710 | Assembly._parse_coverage | test | def _parse_coverage(header_str):
"""Attempts to retrieve the coverage value from the header string.
It splits the header by "_" and then screens the list backwards in
search of the first float value. This will be interpreted as the
coverage value. If it cannot find a float value, it ret... | python | {
"resource": ""
} |
q272711 | Assembly._parse_assembly | test | def _parse_assembly(self, assembly_file):
"""Parse an assembly fasta file.
This is a Fasta parsing method that populates the
:py:attr:`~Assembly.contigs` attribute with data for each contig in the
assembly.
The insertion of data on the self.contigs is done by the
:py:me... | python | {
"resource": ""
} |
q272712 | Assembly._get_gc_content | test | def _get_gc_content(sequence, length):
"""Get GC content and proportions.
Parameters
----------
sequence : str
The complete sequence of the contig.
length : int
The length of the sequence contig.
Returns
-------
x : dict
... | python | {
"resource": ""
} |
q272713 | Assembly.filter_contigs | test | def filter_contigs(self, *comparisons):
"""Filters the contigs of the assembly according to user provided\
comparisons.
The comparisons must be a list of three elements with the
:py:attr:`~Assembly.contigs` key, operator and test value. For
example, to filter contigs with a mini... | python | {
"resource": ""
} |
q272714 | Assembly.get_assembly_length | test | def get_assembly_length(self):
"""Returns the length of the assembly, without the filtered contigs.
Returns
-------
x : int
Total length of the assembly.
"""
return sum(
[vals["length"] for contig_id, vals in self.contigs.items()
if... | python | {
"resource": ""
} |
q272715 | Assembly.write_assembly | test | def write_assembly(self, output_file, filtered=True):
"""Writes the assembly to a new file.
The ``filtered`` option controls whether the new assembly will be
filtered or not.
Parameters
----------
output_file : str
Name of the output assembly file.
f... | python | {
"resource": ""
} |
q272716 | Assembly.write_report | test | def write_report(self, output_file):
"""Writes a report with the test results for the current assembly
Parameters
----------
output_file : str
Name of the output assembly file.
"""
logger.debug("Writing the assembly report into: {}".format(
outp... | python | {
"resource": ""
} |
q272717 | remove_inner_forks | test | def remove_inner_forks(text):
"""Recursively removes nested brackets
This function is used to remove nested brackets from fork strings using
regular expressions
Parameters
----------
text: str
The string that contains brackets with inner forks to be removed
Returns
-------
... | python | {
"resource": ""
} |
q272718 | inner_fork_insanity_checks | test | def inner_fork_insanity_checks(pipeline_string):
"""
This function performs two sanity checks in the pipeline string. The first
check, assures that each fork contains a lane token '|', while the second
check looks for duplicated processes within the same fork.
Parameters
----------
pipeline... | python | {
"resource": ""
} |
q272719 | insanity_checks | test | def insanity_checks(pipeline_str):
"""Wrapper that performs all sanity checks on the pipeline string
Parameters
----------
pipeline_str : str
String with the pipeline definition
"""
# Gets rid of all spaces in string
p_string = pipeline_str.replace(" ", "").strip()
# some of t... | python | {
"resource": ""
} |
q272720 | parse_pipeline | test | def parse_pipeline(pipeline_str):
"""Parses a pipeline string into a list of dictionaries with the connections
between processes
Parameters
----------
pipeline_str : str
String with the definition of the pipeline, e.g.::
'processA processB processC(ProcessD | ProcessE)'
Re... | python | {
"resource": ""
} |
q272721 | get_source_lane | test | def get_source_lane(fork_process, pipeline_list):
"""Returns the lane of the last process that matches fork_process
Parameters
----------
fork_process : list
List of processes before the fork.
pipeline_list : list
List with the pipeline connection dictionaries.
Returns
----... | python | {
"resource": ""
} |
q272722 | get_lanes | test | def get_lanes(lanes_str):
"""From a raw pipeline string, get a list of lanes from the start
of the current fork.
When the pipeline is being parsed, it will be split at every fork
position. The string at the right of the fork position will be provided
to this function. It's job is to retrieve the la... | python | {
"resource": ""
} |
q272723 | linear_connection | test | def linear_connection(plist, lane):
"""Connects a linear list of processes into a list of dictionaries
Parameters
----------
plist : list
List with process names. This list should contain at least two entries.
lane : int
Corresponding lane of the processes
Returns
-------
... | python | {
"resource": ""
} |
q272724 | fork_connection | test | def fork_connection(source, sink, source_lane, lane):
"""Makes the connection between a process and the first processes in the
lanes to which it forks.
The ``lane`` argument should correspond to the lane of the source process.
For each lane in ``sink``, the lane counter will increase.
Parameters
... | python | {
"resource": ""
} |
q272725 | add_unique_identifiers | test | def add_unique_identifiers(pipeline_str):
"""Returns the pipeline string with unique identifiers and a dictionary with
references between the unique keys and the original values
Parameters
----------
pipeline_str : str
Pipeline string
Returns
-------
str
Pipeline strin... | python | {
"resource": ""
} |
q272726 | remove_unique_identifiers | test | def remove_unique_identifiers(identifiers_to_tags, pipeline_links):
"""Removes unique identifiers and add the original process names to the
already parsed pipelines
Parameters
----------
identifiers_to_tags : dict
Match between unique process identifiers and process names
pipeline_links... | python | {
"resource": ""
} |
q272727 | NextflowInspector._check_required_files | test | def _check_required_files(self):
"""Checks whetner the trace and log files are available
"""
if not os.path.exists(self.trace_file):
raise eh.InspectionError("The provided trace file could not be "
"opened: {}".format(self.trace_file))
i... | python | {
"resource": ""
} |
q272728 | NextflowInspector._header_mapping | test | def _header_mapping(header):
"""Parses the trace file header and retrieves the positions of each
column key.
Parameters
----------
header : str
The header line of nextflow's trace file
Returns
-------
dict
Mapping the column ID to... | python | {
"resource": ""
} |
q272729 | NextflowInspector._hms | test | def _hms(s):
"""Converts a hms string into seconds.
Parameters
----------
s : str
The hms string can be something like '20s', '1m30s' or '300ms'.
Returns
-------
float
Time in seconds.
"""
if s == "-":
return... | python | {
"resource": ""
} |
q272730 | NextflowInspector._size_coverter | test | def _size_coverter(s):
"""Converts size string into megabytes
Parameters
----------
s : str
The size string can be '30KB', '20MB' or '1GB'
Returns
-------
float
With the size in bytes
"""
if s.upper().endswith("KB"):
... | python | {
"resource": ""
} |
q272731 | NextflowInspector._get_pipeline_processes | test | def _get_pipeline_processes(self):
"""Parses the .nextflow.log file and retrieves the complete list
of processes
This method searches for specific signatures at the beginning of the
.nextflow.log file::
Apr-19 19:07:32.660 [main] DEBUG nextflow.processor
TaskP... | python | {
"resource": ""
} |
q272732 | NextflowInspector._clear_inspect | test | def _clear_inspect(self):
"""Clears inspect attributes when re-executing a pipeline"""
self.trace_info = defaultdict(list)
self.process_tags = {}
self.process_stats = {}
self.samples = []
self.stored_ids = []
self.stored_log_ids = []
self.time_start = Non... | python | {
"resource": ""
} |
q272733 | NextflowInspector._update_barrier_status | test | def _update_barrier_status(self):
"""Checks whether the channels to each process have been closed.
"""
with open(self.log_file) as fh:
for line in fh:
# Exit barrier update after session abort signal
if "Session aborted" in line:
... | python | {
"resource": ""
} |
q272734 | NextflowInspector._retrieve_log | test | def _retrieve_log(path):
"""Method used to retrieve the contents of a log file into a list.
Parameters
----------
path
Returns
-------
list or None
Contents of the provided file, each line as a list entry
"""
if not os.path.exists(pa... | python | {
"resource": ""
} |
q272735 | NextflowInspector._assess_resource_warnings | test | def _assess_resource_warnings(self, process, vals):
"""Assess whether the cpu load or memory usage is above the allocation
Parameters
----------
process : str
Process name
vals : vals
List of trace information for each tag of that process
Returns... | python | {
"resource": ""
} |
q272736 | NextflowInspector._update_process_stats | test | def _update_process_stats(self):
"""Updates the process stats with the information from the processes
This method is called at the end of each static parsing of the nextflow
trace file. It re-populates the :attr:`process_stats` dictionary
with the new stat metrics.
"""
... | python | {
"resource": ""
} |
q272737 | NextflowInspector.log_parser | test | def log_parser(self):
"""Method that parses the nextflow log file once and updates the
submitted number of samples for each process
"""
# Check the timestamp of the log file. Only proceed with the parsing
# if it changed from the previous time.
size_stamp = os.path.getsi... | python | {
"resource": ""
} |
q272738 | NextflowInspector.update_inspection | test | def update_inspection(self):
"""Wrapper method that calls the appropriate main updating methods of
the inspection.
It is meant to be used inside a loop (like while), so that it can
continuously update the class attributes from the trace and log files.
It already implements check... | python | {
"resource": ""
} |
q272739 | NextflowInspector.display_overview | test | def display_overview(self):
"""Displays the default pipeline inspection overview
"""
stay_alive = True
self.screen = curses.initscr()
self.screen.keypad(True)
self.screen.nodelay(-1)
curses.cbreak()
curses.noecho()
curses.start_color()
... | python | {
"resource": ""
} |
q272740 | NextflowInspector._updown | test | def _updown(self, direction):
"""Provides curses scroll functionality.
"""
if direction == "up" and self.top_line != 0:
self.top_line -= 1
elif direction == "down" and \
self.screen.getmaxyx()[0] + self.top_line\
<= self.content_lines + 3:
... | python | {
"resource": ""
} |
q272741 | NextflowInspector._rightleft | test | def _rightleft(self, direction):
"""Provides curses horizontal padding"""
if direction == "left" and self.padding != 0:
self.padding -= 1
if direction == "right" and \
self.screen.getmaxyx()[1] + self.padding < self.max_width:
self.padding += 1 | python | {
"resource": ""
} |
q272742 | NextflowInspector._get_log_lines | test | def _get_log_lines(self, n=300):
"""Returns a list with the last ``n`` lines of the nextflow log file
Parameters
----------
n : int
Number of last lines from the log file
Returns
-------
list
List of strings with the nextflow log
... | python | {
"resource": ""
} |
q272743 | NextflowInspector._prepare_static_info | test | def _prepare_static_info(self):
"""Prepares the first batch of information, containing static
information such as the pipeline file, and configuration files
Returns
-------
dict
Dict with the static information for the first POST request
"""
pipeline... | python | {
"resource": ""
} |
q272744 | NextflowInspector._dag_file_to_dict | test | def _dag_file_to_dict(self):
"""Function that opens the dotfile named .treeDag.json in the current
working directory
Returns
-------
Returns a dictionary with the dag object to be used in the post
instance available through the method _establish_connection
"""
... | python | {
"resource": ""
} |
q272745 | NextflowInspector._get_run_hash | test | def _get_run_hash(self):
"""Gets the hash of the nextflow file"""
# Get name and path of the pipeline from the log file
pipeline_path = get_nextflow_filepath(self.log_file)
# Get hash from the entire pipeline file
pipeline_hash = hashlib.md5()
with open(pipeline_path, "... | python | {
"resource": ""
} |
q272746 | get_nextflow_filepath | test | def get_nextflow_filepath(log_file):
"""Gets the nextflow file path from the nextflow log file. It searches for
the nextflow run command throughout the file.
Parameters
----------
log_file : str
Path for the .nextflow.log file
Returns
-------
str
Path for the nextflow f... | python | {
"resource": ""
} |
q272747 | main | test | def main(sample_id, assembly, min_size):
"""Main executor of the split_fasta template.
Parameters
----------
sample_id : str
Sample Identification string.
assembly : list
Assembly file.
min_size : int
Minimum contig size.
"""
logger.info("Starting script")
... | python | {
"resource": ""
} |
q272748 | main | test | def main(sample_id, trace_file, workdir):
"""
Parses a nextflow trace file, searches for processes with a specific tag
and sends a JSON report with the relevant information
The expected fields for the trace file are::
0. task_id
1. process
2. tag
3. status
4. ex... | python | {
"resource": ""
} |
q272749 | brew_innuendo | test | def brew_innuendo(args):
"""Brews a given list of processes according to the recipe
Parameters
----------
args : argparse.Namespace
The arguments passed through argparser that will be used to check the
the recipe, tasks and brew the process
Returns
-------
str
The f... | python | {
"resource": ""
} |
q272750 | brew_recipe | test | def brew_recipe(recipe_name):
"""Returns a pipeline string from a recipe name.
Parameters
----------
recipe_name : str
Name of the recipe. Must match the name attribute in one of the classes
defined in :mod:`flowcraft.generator.recipes`
Returns
-------
str
Pipeline ... | python | {
"resource": ""
} |
q272751 | list_recipes | test | def list_recipes(full=False):
"""Method that iterates over all available recipes and prints their
information to the standard output
Parameters
----------
full : bool
If true, it will provide the pipeline string along with the recipe name
"""
logger.info(colored_print(
"\n=... | python | {
"resource": ""
} |
q272752 | InnuendoRecipe.validate_pipeline | test | def validate_pipeline(pipeline_string):
"""Validate pipeline string
Validates the pipeline string by searching for forbidden characters
Parameters
----------
pipeline_string : str
STring with the processes provided
Returns
-------
"""
... | python | {
"resource": ""
} |
q272753 | InnuendoRecipe.build_upstream | test | def build_upstream(self, process_descriptions, task, all_tasks,
task_pipeline,
count_forks, total_tasks, forks):
"""Builds the upstream pipeline of the current process
Checks for the upstream processes to the current process and
adds them to the cur... | python | {
"resource": ""
} |
q272754 | InnuendoRecipe.build_downstream | test | def build_downstream(self, process_descriptions, task, all_tasks,
task_pipeline,
count_forks, total_tasks, forks):
"""Builds the downstream pipeline of the current process
Checks for the downstream processes to the current process and
adds them ... | python | {
"resource": ""
} |
q272755 | InnuendoRecipe.define_pipeline_string | test | def define_pipeline_string(self, process_descriptions, tasks,
check_upstream,
check_downstream, count_forks, total_tasks,
forks):
"""Builds the possible forks and connections between the provided
processes
... | python | {
"resource": ""
} |
q272756 | InnuendoRecipe.run_auto_pipeline | test | def run_auto_pipeline(self, tasks):
"""Main method to run the automatic pipeline creation
This method aggregates the functions required to build the pipeline
string that can be used as input for the workflow generator.
Parameters
----------
tasks : str
A str... | python | {
"resource": ""
} |
q272757 | Recipe._get_component_str | test | def _get_component_str(component, params=None, directives=None):
""" Generates a component string based on the provided parameters and
directives
Parameters
----------
component : str
Component name
params : dict
Dictionary with parameter informat... | python | {
"resource": ""
} |
q272758 | write_report | test | def write_report(storage_dic, output_file, sample_id):
""" Writes a report from multiple samples.
Parameters
----------
storage_dic : dict or :py:class:`OrderedDict`
Storage containing the trimming statistics. See :py:func:`parse_log`
for its generation.
output_file : str
Pa... | python | {
"resource": ""
} |
q272759 | main | test | def main(log_files):
""" Main executor of the trimmomatic_report template.
Parameters
----------
log_files : list
List of paths to the trimmomatic log files.
"""
log_storage = OrderedDict()
for log in log_files:
log_id = log.rstrip("_trimlog.txt")
# Populate stor... | python | {
"resource": ""
} |
q272760 | fix_contig_names | test | def fix_contig_names(asseembly_path):
"""Removes whitespace from the assembly contig names
Parameters
----------
asseembly_path : path to assembly file
Returns
-------
str:
Path to new assembly file with fixed contig names
"""
fixed_assembly = "fixed_assembly.fa"
with... | python | {
"resource": ""
} |
q272761 | clean_up | test | def clean_up(fastq):
"""
Cleans the temporary fastq files. If they are symlinks, the link
source is removed
Parameters
----------
fastq : list
List of fastq files.
"""
for fq in fastq:
# Get real path of fastq files, following symlinks
rp = os.path.realpath(fq)
... | python | {
"resource": ""
} |
q272762 | Abricate.parse_files | test | def parse_files(self, fls):
"""Public method for parsing abricate output files.
This method is called at at class instantiation for the provided
output files. Additional abricate output files can be added using
this method after the class instantiation.
Parameters
-----... | python | {
"resource": ""
} |
q272763 | Abricate._parser | test | def _parser(self, fl):
"""Parser for a single abricate output file.
This parser will scan a single Abricate output file and populate
the :py:attr:`Abricate.storage` attribute.
Parameters
----------
fl : str
Path to abricate output file
Notes
... | python | {
"resource": ""
} |
q272764 | Abricate.iter_filter | test | def iter_filter(self, filters, databases=None, fields=None,
filter_behavior="and"):
"""General purpose filter iterator.
This general filter iterator allows the filtering of entries based
on one or more custom filters. These filters must contain
an entry of the `stora... | python | {
"resource": ""
} |
q272765 | AbricateReport._get_contig_id | test | def _get_contig_id(contig_str):
"""Tries to retrieve contig id. Returns the original string if it
is unable to retrieve the id.
Parameters
----------
contig_str : str
Full contig string (fasta header)
Returns
-------
str
Contig id... | python | {
"resource": ""
} |
q272766 | AbricateReport.get_plot_data | test | def get_plot_data(self):
""" Generates the JSON report to plot the gene boxes
Following the convention of the reports platform, this method returns
a list of JSON/dict objects with the information about each entry in
the abricate file. The information contained in this JSON is::
... | python | {
"resource": ""
} |
q272767 | AbricateReport.write_report_data | test | def write_report_data(self):
"""Writes the JSON report to a json file
"""
json_plot = self.get_plot_data()
json_table = self.get_table_data()
json_dic = {**json_plot, **json_table}
with open(".report.json", "w") as json_report:
json_report.write(json.dumps(... | python | {
"resource": ""
} |
q272768 | main | test | def main(sample_id, assembly_file, coverage_bp_file=None):
"""Main executor of the assembly_report template.
Parameters
----------
sample_id : str
Sample Identification string.
assembly_file : str
Path to assembly file in Fasta format.
"""
logger.info("Starting assembly re... | python | {
"resource": ""
} |
q272769 | Assembly._parse_assembly | test | def _parse_assembly(self, assembly_file):
"""Parse an assembly file in fasta format.
This is a Fasta parsing method that populates the
:py:attr:`Assembly.contigs` attribute with data for each contig in the
assembly.
Parameters
----------
assembly_file : str
... | python | {
"resource": ""
} |
q272770 | Assembly.get_summary_stats | test | def get_summary_stats(self, output_csv=None):
"""Generates a CSV report with summary statistics about the assembly
The calculated statistics are:
- Number of contigs
- Average contig size
- N50
- Total assembly length
- Average GC content
... | python | {
"resource": ""
} |
q272771 | Assembly._get_window_labels | test | def _get_window_labels(self, window):
"""Returns the mapping between sliding window points and their contigs,
and the x-axis position of contig
Parameters
----------
window : int
Size of the window.
Returns
-------
xbars : list
Th... | python | {
"resource": ""
} |
q272772 | Assembly._gc_prop | test | def _gc_prop(s, length):
"""Get proportion of GC from a string
Parameters
----------
s : str
Arbitrary string
Returns
-------
x : float
GC proportion.
"""
gc = sum(map(s.count, ["c", "g"]))
return gc / length | python | {
"resource": ""
} |
q272773 | Assembly.get_gc_sliding | test | def get_gc_sliding(self, window=2000):
"""Calculates a sliding window of the GC content for the assembly
Returns
-------
gc_res : list
List of GC proportion floats for each data point in the sliding
window
"""
gc_res = []
# Get complete... | python | {
"resource": ""
} |
q272774 | main | test | def main(sample_id, fastq_pair, clear):
"""Main executor of the skesa template.
Parameters
----------
sample_id : str
Sample Identification string.
fastq_pair : list
Two element list containing the paired FastQ files.
clear : str
Can be either 'true' or 'false'. If 'true... | python | {
"resource": ""
} |
q272775 | write_json_report | test | def write_json_report(sample_id, data1, data2):
"""Writes the report
Parameters
----------
data1
data2
Returns
-------
"""
parser_map = {
"base_sequence_quality": ">>Per base sequence quality",
"sequence_quality": ">>Per sequence quality scores",
"base_gc_... | python | {
"resource": ""
} |
q272776 | get_trim_index | test | def get_trim_index(biased_list):
"""Returns the trim index from a ``bool`` list
Provided with a list of ``bool`` elements (``[False, False, True, True]``),
this function will assess the index of the list that minimizes the number
of True elements (biased positions) at the extremities. To do so,
it ... | python | {
"resource": ""
} |
q272777 | trim_range | test | def trim_range(data_file):
"""Assess the optimal trim range for a given FastQC data file.
This function will parse a single FastQC data file, namely the
*'Per base sequence content'* category. It will retrieve the A/T and G/C
content for each nucleotide position in the reads, and check whether the
... | python | {
"resource": ""
} |
q272778 | get_sample_trim | test | def get_sample_trim(p1_data, p2_data):
"""Get the optimal read trim range from data files of paired FastQ reads.
Given the FastQC data report files for paired-end FastQ reads, this
function will assess the optimal trim range for the 3' and 5' ends of
the paired-end reads. This assessment will be based ... | python | {
"resource": ""
} |
q272779 | get_summary | test | def get_summary(summary_file):
"""Parses a FastQC summary report file and returns it as a dictionary.
This function parses a typical FastQC summary report file, retrieving
only the information on the first two columns. For instance, a line could
be::
'PASS Basic Statistics SH10762A_1.fastq.gz'... | python | {
"resource": ""
} |
q272780 | check_summary_health | test | def check_summary_health(summary_file, **kwargs):
"""Checks the health of a sample from the FastQC summary file.
Parses the FastQC summary file and tests whether the sample is good
or not. There are four categories that cannot fail, and two that
must pass in order for the sample pass this check. If the... | python | {
"resource": ""
} |
q272781 | Bowtie.parse_log | test | def parse_log(self, bowtie_log):
"""Parse a bowtie log file.
This is a bowtie log parsing method that populates the
:py:attr:`self.n_reads, self.align_0x, self.align_1x, self.align_mt1x and self.overall_rate` attributes with
data from the log file.
Disclamer: THIS METHOD IS HOR... | python | {
"resource": ""
} |
q272782 | NextflowGenerator._parse_process_name | test | def _parse_process_name(name_str):
"""Parses the process string and returns the process name and its
directives
Process strings my contain directive information with the following
syntax::
proc_name={'directive':'val'}
This method parses this string and returns the... | python | {
"resource": ""
} |
q272783 | NextflowGenerator._add_dependency | test | def _add_dependency(self, p, template, inlane, outlane, pid):
"""Automatically Adds a dependency of a process.
This method adds a template to the process list attribute as a
dependency. It will adapt the input lane, output lane and process
id of the process that depends on it.
... | python | {
"resource": ""
} |
q272784 | NextflowGenerator._search_tree_backwards | test | def _search_tree_backwards(self, template, parent_lanes):
"""Searches the process tree backwards in search of a provided process
The search takes into consideration the provided parent lanes and
searches only those
Parameters
----------
template : str
Name o... | python | {
"resource": ""
} |
q272785 | NextflowGenerator._build_header | test | def _build_header(self):
"""Adds the header template to the master template string
"""
logger.debug("===============")
logger.debug("Building header")
logger.debug("===============")
self.template += hs.header | python | {
"resource": ""
} |
q272786 | NextflowGenerator._build_footer | test | def _build_footer(self):
"""Adds the footer template to the master template string"""
logger.debug("===============")
logger.debug("Building header")
logger.debug("===============")
self.template += fs.footer | python | {
"resource": ""
} |
q272787 | NextflowGenerator._set_channels | test | def _set_channels(self):
"""Sets the main channels for the pipeline
This method will parse de the :attr:`~Process.processes` attribute
and perform the following tasks for each process:
- Sets the input/output channels and main input forks and adds
them to the process'... | python | {
"resource": ""
} |
q272788 | NextflowGenerator._set_init_process | test | def _set_init_process(self):
"""Sets the main raw inputs and secondary inputs on the init process
This method will fetch the :class:`flowcraft.process.Init` process
instance and sets the raw input (
:func:`flowcraft.process.Init.set_raw_inputs`) for
that process. This will handl... | python | {
"resource": ""
} |
q272789 | NextflowGenerator._set_secondary_channels | test | def _set_secondary_channels(self):
"""Sets the secondary channels for the pipeline
This will iterate over the
:py:attr:`NextflowGenerator.secondary_channels` dictionary that is
populated when executing
:func:`~NextflowGenerator._update_secondary_channels` method.
"""
... | python | {
"resource": ""
} |
q272790 | NextflowGenerator._set_status_channels | test | def _set_status_channels(self):
"""Compiles all status channels for the status compiler process
"""
status_inst = pc.StatusCompiler(template="status_compiler")
report_inst = pc.ReportCompiler(template="report_compiler")
# Compile status channels from pipeline process
st... | python | {
"resource": ""
} |
q272791 | NextflowGenerator._get_resources_string | test | def _get_resources_string(res_dict, pid):
""" Returns the nextflow resources string from a dictionary object
If the dictionary has at least on of the resource directives, these
will be compiled for each process in the dictionary and returned
as a string read for injection in the nextflo... | python | {
"resource": ""
} |
q272792 | NextflowGenerator._get_container_string | test | def _get_container_string(cont_dict, pid):
""" Returns the nextflow containers string from a dictionary object
If the dictionary has at least on of the container directives, these
will be compiled for each process in the dictionary and returned
as a string read for injection in the next... | python | {
"resource": ""
} |
q272793 | NextflowGenerator._get_params_string | test | def _get_params_string(self):
"""Returns the nextflow params string from a dictionary object.
The params dict should be a set of key:value pairs with the
parameter name, and the default parameter value::
self.params = {
"genomeSize": 2.1,
"minCoverag... | python | {
"resource": ""
} |
q272794 | NextflowGenerator._get_merged_params_string | test | def _get_merged_params_string(self):
"""Returns the merged nextflow params string from a dictionary object.
The params dict should be a set of key:value pairs with the
parameter name, and the default parameter value::
self.params = {
"genomeSize": 2.1,
... | python | {
"resource": ""
} |
q272795 | NextflowGenerator._get_manifest_string | test | def _get_manifest_string(self):
"""Returns the nextflow manifest config string to include in the
config file from the information on the pipeline.
Returns
-------
str
Nextflow manifest configuration string
"""
config_str = ""
config_str += '... | python | {
"resource": ""
} |
q272796 | NextflowGenerator._set_configurations | test | def _set_configurations(self):
"""This method will iterate over all process in the pipeline and
populate the nextflow configuration files with the directives
of each process in the pipeline.
"""
logger.debug("======================")
logger.debug("Setting configurations"... | python | {
"resource": ""
} |
q272797 | NextflowGenerator.dag_to_file | test | def dag_to_file(self, dict_viz, output_file=".treeDag.json"):
"""Writes dag to output file
Parameters
----------
dict_viz: dict
Tree like dictionary that is used to export tree data of processes
to html file and here for the dotfile .treeDag.json
"""
... | python | {
"resource": ""
} |
q272798 | NextflowGenerator.render_pipeline | test | def render_pipeline(self):
"""Write pipeline attributes to json
This function writes the pipeline and their attributes to a json file,
that is intended to be read by resources/pipeline_graph.html to render
a graphical output showing the DAG.
"""
dict_viz = {
... | python | {
"resource": ""
} |
q272799 | NextflowGenerator.write_configs | test | def write_configs(self, project_root):
"""Wrapper method that writes all configuration files to the pipeline
directory
"""
# Write resources config
with open(join(project_root, "resources.config"), "w") as fh:
fh.write(self.resources)
# Write containers conf... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.