Skip to content

Instantly share code, notes, and snippets.

# Command I use to build the image
# docker buildx build --build-arg CONDA_PACKAGES=./envs/nsap_packages.txt --platform linux/amd64 -t alantwaddle/nsap_test:1.6 --push .
# (c) 2012 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@twaddlac
twaddlac / all-primary-screen.sql
Created March 13, 2020 21:00
Retrieve all primary screen
## To get back all of the primary screen first pass interesting experiment images for Amalia and Victoria
## Select the fields of interest
SELECT
s.screen_name,
# a.assay_code_name, # the assay itself (not needed, redundant with library plate coordinates)
a.assay_image_path,
l.ReagentName, # the reagent used
l.MasterPlateWell, l.StockPlateWell, # library coordinates for the reagent
# m.treatment_group_id, # treatment group (ignore for now)
@twaddlac
twaddlac / boxem-image-paths.sql
Created March 13, 2020 21:00
Get image filepaths for Boxem's images
# get JUST the image file paths for
# matching RNAi controls for "FIRST-PASS INTERESTING"
# from am and vi screens (12 and 14)
SELECT b.assay_image_path
FROM exp_assay a,
exp_assay b,
exp_design d,
exp_manual_scores AS m,
@twaddlac
twaddlac / eegi-secondary-screen.sql
Created September 27, 2018 16:05
Query to extract the secondary screen data from the eegi db.
select
experiment.well,
experiment.worm_strain_id,
experimentplate.temperature,
experimentplate.date,
experiment.library_stock_id,
wormstrain.*,
librarystock.*,
experiment.*,
experimentplate.*,
Chain INPUT (policy ACCEPT)
target prot opt source destination
delegate_input all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
@twaddlac
twaddlac / gist:ee42e967f3a70dda68ea9cda9dc23bfe
Created August 16, 2018 15:06
Query used to denromalize the secondary screens of eegi ny db
select
experiment.well,
experiment.worm_strain_id,
experimentplate.temperature,
experimentplate.date,
experiment.library_stock_id,
wormstrain.*,
librarystock.*,
experiment.*,
@twaddlac
twaddlac / parse-michelled-xml.py
Created June 26, 2018 15:09
XML to TSV parser for Michelle.
import xml.etree.ElementTree
import re
root = xml.etree.ElementTree.parse('RNAi.fixed.xml').getroot()
pattern = re.compile("\w")
def get_text_list(child,path):
l = list()
for i in child.findall(path):
if pattern.match(i.text):
# This defines the language that you're script is written int - most likely it's always bash/sh.
#!/bin/sh
#SBATCH --job-name=filter_abund
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=12
#SBATCH --mem=24GB
#SBATCH --time=72:00:00
#SBATCH --mail-type=ALL
#SBATCH [email protected]
#!/bin/sh
module load trimmomatic
cd /scratch/at120/gabby-laura-stats/
# for i in $(ls *fastq | perl -pe 's/\.fastq//g'); do mv $i.fastq $(echo $i | perl -pe 's/^C.+l0(\d)n0(\d)_(.+)\.3.+/$3_l$1.r$2.fastq/g'); done
# for i in $( ls *fastq | perl -pe 's/\.r\d\.fastq//g' | sort | uniq); do sbatch --export=fastq=$i trimmomatic.sh ; done
java -jar /share/apps/trimmomatic/0.36/trimmomatic-0.36.jar PE -threads 12 $fastq.r1.fastq $fastq.r2.fastq -baseout $fastq.fastq ILLUMINACLIP:adapters.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36
@twaddlac
twaddlac / trim-and-filter.sh
Created May 25, 2017 16:09
steps used to generate statistics for gabby and laura's data
module load trimmomatic
cd /scratch/at120/gabby-laura-stats/
# for i in $(ls *fastq | perl -pe 's/\.fastq//g'); do mv $i.fastq $(echo $i | perl -pe 's/^C.+l0(\d)n0(\d)_(.+)\.3.+/$3_l$1.r$2.fastq/g'); done
java -jar /share/apps/trimmomatic/0.36/trimmomatic-0.36.jar PE -threads 12 $fastq.r1.fastq $fastq.r2.fastq -baseout $fastq.fastq ILLUMINACLIP:adapters.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36