This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This file contains pin mappings for the Wanhao Duplicator 9 MK1, | |
| # also sold as the Monoprice Maker Pro MK1. To use this config, | |
| # the firmware should be compiled for the AVR atmega2560. | |
| # See the example.cfg file for a description of available parameters. | |
| [stepper_x] | |
| step_pin: PF7 | |
| dir_pin: !PK0 | |
| enable_pin: !PF6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| title <- "Kinds of sunscreen I get to use:" | |
| names <- c("SunSport Waterproof SPF30", | |
| "The organic zinc kids one", | |
| "The moisturizing one", | |
| "The expensive one", | |
| "The one I like") | |
| colors <- c("#EFD8B5", "#F9EDD4", "#CDE2CE", "#82C6BD", "#5BB6CC") | |
| data <- data.frame(values=c(80,12,5,2,1), names=factor(names, levels=names)) | |
| library(ggplot2) | |
| library(xkcd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Spotfire.Dxp.Application.Visuals import VisualContent | |
| vc = vis.As[VisualContent]() | |
| dataTable=vc.Data.DataTableReference | |
| marking=vc.Data.MarkingReference | |
| marking.SetSelection(marking.GetSelection(dataTable),dataTable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gffutils | |
| import os.path | |
| from pyfaidx import Fasta | |
| gtf_path = "/path/to/gencode.gtf" | |
| gtf_db = gtf_path + ".db" | |
| fasta_path = "/path/to/hg38.fasta" | |
| if os.path.exists(gtf_db): | |
| db = gffutils.FeatureDB(gtf_db) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rule screenshot_config: | |
| input: bam="{dataset}.sort.bam", bai="{dataset}.sort.bam.bai", calls="{dataset}.calls" | |
| output: batch="{dataset}.igv.batch" | |
| params: runtime="600", memory="1G", filename="{dataset}.alignments.png" | |
| run: | |
| import os.path | |
| batch_template = """load {bam} | |
| preference SAM.SHOW_CENTER_LINE false | |
| snapshotDirectory {directory} | |
| genome hg38 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import vcf | |
| file = '' | |
| with open('outfile.txt', 'w') as out: | |
| for variant in vcf.Reader(open(file)): | |
| if len(variant.FILTER) == 0: | |
| if variant.is_snp: | |
| for sample in variant.samples: | |
| ref, alt = sample.gt_bases.replace('|', '/').split('/') | |
| print(variant.CHROM, str(variant.POS), ref, alt, sep='\t', file=out) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from simplesam import Reader | |
| with Reader(open("input.sam")) as sam, open("output.fastq", "w") as fastq: | |
| for read in sam: | |
| fastq.write("@%s\n" % read.qname) | |
| fastq.write("%s\n" % read.seq) | |
| fastq.write("+\n") | |
| fastq.write("%s\n" % read.qual) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Bio import bgzf | |
| with bgzf.open('Homo_sapiens.GRCh38.dna.primary_assembly.fa.gz') as fasta: | |
| fasta.tell() | |
| for line in fasta: | |
| if line.startswith('>'): | |
| fasta.tell() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pyfaidx import Fasta | |
| # positions.txt: | |
| # chr1 1 T | |
| # chr1 100 C | |
| # chr2 10 G | |
| # ... | |
| with open('positions.txt') as mut_table: | |
| # mutable Fasta modifies input file in-place |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gffutils | |
| import pyfaidx | |
| db = gffutils.create_db('input.gff') | |
| fasta = pyfaidx.Fasta('input.fa') | |
| for cds in db.features_of_type('cds', order_by='start'): | |
| print(cds.sequence(fasta)) |
NewerOlder