Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.datatypes.converters package

Submodules

galaxy.datatypes.converters.bed_to_gff_converter module

galaxy.datatypes.converters.bedgraph_to_array_tree_converter module

class galaxy.datatypes.converters.bedgraph_to_array_tree_converter.BedGraphReader(f)[source]

Bases: six.Iterator

__init__(f)[source]
galaxy.datatypes.converters.bedgraph_to_array_tree_converter.main()[source]

galaxy.datatypes.converters.bgzip module

Uses pysam to bgzip a file

usage: %prog in_file out_file

galaxy.datatypes.converters.bgzip.main()[source]

galaxy.datatypes.converters.cram_to_bam module

Uses pysam to convert a CRAM file to a sorted bam file. usage: %prog in_file out_file

galaxy.datatypes.converters.cram_to_bam.main()[source]

galaxy.datatypes.converters.fasta_to_len module

Input: fasta, int Output: tabular Return titles with lengths of corresponding seq

galaxy.datatypes.converters.fasta_to_len.compute_fasta_length(fasta_file, out_file, keep_first_char, keep_first_word=False)[source]

galaxy.datatypes.converters.fasta_to_tabular_converter module

Input: fasta Output: tabular

galaxy.datatypes.converters.fastq_to_fqtoc module

galaxy.datatypes.converters.fastq_to_fqtoc.main()[source]

The format of the file is JSON:

{ "sections" : [
        { "start" : "x", "end" : "y", "sequences" : "z" },
        ...
]}

This works only for UNCOMPRESSED fastq files. The Python GzipFile does not provide seekable offsets via tell(), so clients just have to split the slow way

galaxy.datatypes.converters.fastqsolexa_to_fasta_converter module

convert fastqsolexa file to separated sequence and quality files.

assume each sequence and quality score are contained in one line the order should be: 1st line: @title_of_seq 2nd line: nucleotides 3rd line: +title_of_qualityscore (might be skipped) 4th line: quality scores (in three forms: a. digits, b. ASCII codes, the first char as the coding base, c. ASCII codes without the first char.)

Usage: %python fastqsolexa_to_fasta_converter.py <your_fastqsolexa_filename> <output_seq_filename> <output_score_filename>

galaxy.datatypes.converters.fastqsolexa_to_fasta_converter.stop_err(msg)[source]

galaxy.datatypes.converters.fastqsolexa_to_qual_converter module

convert fastqsolexa file to separated sequence and quality files.

assume each sequence and quality score are contained in one line the order should be: 1st line: @title_of_seq 2nd line: nucleotides 3rd line: +title_of_qualityscore (might be skipped) 4th line: quality scores (in three forms: a. digits, b. ASCII codes, the first char as the coding base, c. ASCII codes without the first char.)

Usage: %python fastqsolexa_to_qual_converter.py <your_fastqsolexa_filename> <output_seq_filename> <output_score_filename>

galaxy.datatypes.converters.fastqsolexa_to_qual_converter.stop_err(msg)[source]

galaxy.datatypes.converters.gff_to_bed_converter module

galaxy.datatypes.converters.gff_to_interval_index_converter module

Convert from GFF file to interval index file.

usage:
python gff_to_interval_index_converter.py [input] [output]
galaxy.datatypes.converters.gff_to_interval_index_converter.main()[source]

galaxy.datatypes.converters.interval_to_bed_converter module

galaxy.datatypes.converters.interval_to_bed_converter.stop_err(msg)[source]

galaxy.datatypes.converters.interval_to_bedstrict_converter module

galaxy.datatypes.converters.interval_to_bedstrict_converter.stop_err(msg)[source]
galaxy.datatypes.converters.interval_to_bedstrict_converter.force_bed_field_count(fields, region_count, force_num_columns)[source]

galaxy.datatypes.converters.interval_to_coverage module

Converter to generate 3 (or 4) column base-pair coverage from an interval file.

usage: %prog bed_file out_file
-1, –cols1=N,N,N,N: Columns for chrom, start, end, strand in interval file -2, –cols2=N,N,N,N: Columns for chrom, start, end, strand in coverage file
galaxy.datatypes.converters.interval_to_coverage.main(interval, coverage)[source]

Uses a sliding window of partitions to count coverages. Every interval record adds its start and end to the partitions. The result is a list of partitions, or every position that has a (maybe) different number of basepairs covered. We don’t worry about merging because we pop as the sorted intervals are read in. As the input start positions exceed the partition positions in partitions, coverages are kicked out in bulk.

class galaxy.datatypes.converters.interval_to_coverage.CoverageWriter(out_stream=None, chromCol=0, positionCol=1, forwardCol=2, reverseCol=3)[source]

Bases: object

__init__(out_stream=None, chromCol=0, positionCol=1, forwardCol=2, reverseCol=3)[source]
write(**kwargs)[source]
close()[source]

galaxy.datatypes.converters.interval_to_fli module

Creates a feature location index (FLI) for a given BED/GFF file. FLI index has the form:

[line_length]
<symbol1_in_lowercase><tab><symbol1><tab><location>
<symbol2_in_lowercase><tab><symbol2><tab><location>
...

where location is formatted as:

contig:start-end

and symbols are sorted in lexigraphical order.

galaxy.datatypes.converters.interval_to_fli.main()[source]

galaxy.datatypes.converters.interval_to_interval_index_converter module

Convert from interval file to interval index file.

usage: %prog <options> in_file out_file
-c, –chr-col: chromosome column, default=1 -s, –start-col: start column, default=2 -e, –end-col: end column, default=3
galaxy.datatypes.converters.interval_to_interval_index_converter.main()[source]

galaxy.datatypes.converters.interval_to_tabix_converter module

Uses pysam to index a bgzipped interval file with tabix Supported presets: bed, gff, vcf

usage: %prog in_file out_file

galaxy.datatypes.converters.interval_to_tabix_converter.main()[source]
galaxy.datatypes.converters.interval_to_tabix_converter.to_tabix(bgzip_fname, out_fname, preset=None, chrom_col=None, start_col=None, end_col=None)[source]

galaxy.datatypes.converters.lped_to_fped_converter module

galaxy.datatypes.converters.lped_to_fped_converter.timenow()[source]

return current time as a string

galaxy.datatypes.converters.lped_to_fped_converter.rgConv(inpedfilepath, outhtmlname, outfilepath)[source]

convert linkage ped/map to fbat

galaxy.datatypes.converters.lped_to_fped_converter.main()[source]

call fbater need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path <command>python ‘$__tool_directory__/rg_convert_lped_fped.py’ ‘$input1/$input1.metadata.base_name’ ‘$output1’ ‘$output1.extra_files_path’ </command>

galaxy.datatypes.converters.lped_to_pbed_converter module

galaxy.datatypes.converters.lped_to_pbed_converter.timenow()[source]

return current time as a string

galaxy.datatypes.converters.lped_to_pbed_converter.getMissval(inped='')[source]

read some lines…ugly hack - try to guess missing value should be N or 0 but might be . or -

galaxy.datatypes.converters.lped_to_pbed_converter.rgConv(inpedfilepath, outhtmlname, outfilepath, plink)[source]
galaxy.datatypes.converters.lped_to_pbed_converter.main()[source]

need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path <command>python ‘$__tool_directory__/lped_to_pbed_converter.py’ ‘$input1/$input1.metadata.base_name’ ‘$output1’ ‘$output1.extra_files_path’ ‘${GALAXY_DATA_INDEX_DIR}/rg/bin/plink’ </command>

galaxy.datatypes.converters.maf_to_fasta_converter module

galaxy.datatypes.converters.maf_to_interval_converter module

galaxy.datatypes.converters.pbed_ldreduced_converter module

galaxy.datatypes.converters.pbed_ldreduced_converter.timenow()[source]

return current time as a string

galaxy.datatypes.converters.pbed_ldreduced_converter.pruneLD(plinktasks=[], cd='./', vclbase=[])[source]
galaxy.datatypes.converters.pbed_ldreduced_converter.makeLDreduced(basename, infpath=None, outfpath=None, plinke='plink', forcerebuild=False, returnFname=False, winsize='60', winmove='40', r2thresh='0.1')[source]

not there so make and leave in output dir for post job hook to copy back into input extra files path for next time

galaxy.datatypes.converters.pbed_ldreduced_converter.main()[source]

need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path

galaxy.datatypes.converters.pbed_to_lped_converter module

galaxy.datatypes.converters.pbed_to_lped_converter.timenow()[source]

return current time as a string

galaxy.datatypes.converters.pbed_to_lped_converter.rgConv(inpedfilepath, outhtmlname, outfilepath, plink)[source]
galaxy.datatypes.converters.pbed_to_lped_converter.main()[source]

need to work with rgenetics composite datatypes so in and out are html files with data in extrafiles path <command>python ‘$__tool_directory__/pbed_to_lped_converter.py’ ‘$input1/$input1.metadata.base_name’ ‘$output1’ ‘$output1.extra_files_path’ ‘${GALAXY_DATA_INDEX_DIR}/rg/bin/plink’ </command>

galaxy.datatypes.converters.picard_interval_list_to_bed6_converter module

galaxy.datatypes.converters.pileup_to_interval_index_converter module

Convert from pileup file to interval index file.

usage: %prog <options> in_file out_file

galaxy.datatypes.converters.pileup_to_interval_index_converter.main()[source]

galaxy.datatypes.converters.ref_to_seq_taxonomy_converter module

convert a ref.taxonomy file to a seq.taxonomy file Usage: %python ref_to_seq_taxonomy_converter.py <ref.taxonom> <seq.taxonomy>

galaxy.datatypes.converters.sam_to_bam module

A wrapper script for converting SAM to BAM, with sorting. %prog input_filename.sam output_filename.bam

galaxy.datatypes.converters.sam_to_bam.cleanup_before_exit(tmp_dir)[source]
galaxy.datatypes.converters.sam_to_bam.cmd_exists(cmd)[source]

galaxy.datatypes.converters.tabular_to_dbnsfp module

Uses pysam to bgzip a file

usage: %prog in_file out_file

galaxy.datatypes.converters.tabular_to_dbnsfp.main()[source]

galaxy.datatypes.converters.vcf_to_interval_index_converter module

Convert from VCF file to interval index file.

galaxy.datatypes.converters.vcf_to_interval_index_converter.main()[source]

galaxy.datatypes.converters.vcf_to_vcf_bgzip module

Uses pysam to bgzip a vcf file as-is. Headers, which are important, are kept. Original ordering, which may be specifically needed by tools or external display applications, is also maintained.

usage: %prog in_file out_file

galaxy.datatypes.converters.vcf_to_vcf_bgzip.main()[source]

galaxy.datatypes.converters.wiggle_to_array_tree_converter module

galaxy.datatypes.converters.wiggle_to_array_tree_converter.main()[source]

galaxy.datatypes.converters.wiggle_to_simple_converter module

Read a wiggle track and print out a series of lines containing “chrom position score”. Ignores track lines, handles bed, variableStep and fixedStep wiggle lines.

galaxy.datatypes.converters.wiggle_to_simple_converter.stop_err(msg)[source]
galaxy.datatypes.converters.wiggle_to_simple_converter.main()[source]