Skip to content

Instantly share code, notes, and snippets.

import readin
import sys
if len(sys.argv) < 2:
print "No Input"
else:
s = readin.readDataFromFile(sys.argv[1])
out_dict = {"A":0,"T":0,"C":0,"G":0}
for i in "ATCG":
out_dict[i] = s.count(i)
import readin
import sys
if len(sys.argv) < 2:
print "No Input"
elif len(sys.argv) < 3:
print "No Output"
else:
t = readin.readDataFromFile(sys.argv[1])
#print t
import sys
def lineTest(tabl,ind,num):
switch = True
for i in tabl[ind]:
if i > num:
switch = False
break
return switch
@ChristinaLK
ChristinaLK / generate_df.R
Last active July 11, 2017 11:37
Looping over spreadsheets to combine into a single dataframe
library(dplyr)
# create empty dataframe
df <- data.frame(Domain=character(),
Total=integer(),
Date=character())
# loop thru data files + add to data frame
for (date in c('2012-2013','2014-2015','2016-2017')) {
# set data file path + read in data
data <- load_data(date=date, time=365)
FROM python:3.6-stretch
COPY Miniconda3-latest-Linux-x86_64.sh /tmp
RUN mkdir /home/qiimeuser
ENV HOME /home/qiimeuser
RUN cd /tmp && \
./Miniconda3-latest-Linux-x86_64.sh -b -p /home/qiimeuser/miniconda3 && \
export PATH=/home/qiimeuser/miniconda3/bin:$PATH && \
@ChristinaLK
ChristinaLK / run.singularity.sh
Last active April 28, 2019 12:57
Using singularity image to run jobs in CHTC
#!/bin/bash
img=$1
exec=$2
shift 2
args=$*
singularity exec -B $_CONDOR_SCRATCH_DIR:/scratch $img /scratch/$exec $args
#!/bin/bash
img=$1
exec=$2
shift 2
args=$*
cp /mnt/gluster/username/$img ./
singularity exec -B $_CONDOR_SCRATCH_DIR:/scratch $img /scratch/$exec $args
@ChristinaLK
ChristinaLK / args.R
Last active February 10, 2022 22:39
using command line arguments
## use:
## Rscript args.R 1 hello TRUE
values <- commandArgs(trailingOnly=TRUE)
print(values)
jobnumber <- values[1]
print(jobnumber)
# if you want to use jobnumber as a NUMBER, not a STRING
#!/bin/bash
# this script is meant to be run on hpclogin2.chtc.wisc.edu
# it assumes that the gromacs-2022.tar.gz file has been downloaded to /software/smunawar
# To run the script, run the following command:
# bash install.sh
# move to local disk for the compilation
mkdir /software/smunawar/gromacs
cd /scratch/local/smunawar
cp /software/smunawar/gromacs-2022.tar.gz ./
executable = run_python.sh
arguments = $(cw) $(hfiii) $(hfii) $(hfi) $(l)
transfer_output_remaps = "$(cow)_$(heiferIII)_$(heiferII)_$(heiferI)_$(calf).tar.gz=$(cow)/$(calf)/$(cow)_$(heiferIII)_$(heiferII)_$(heiferI)_$(calf).tar.gz"
queue cw,hfiii,hfii,hfi,l from csv
------
#!/bin/bash