-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repo jbei org changes #5
base: master
Are you sure you want to change the base?
Changes from 5 commits
64a3d92
81be326
c1c0d36
6174548
cc561bd
56d43df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +0,0 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
def predict_loading_concentration(spectra,model,low=5,high=20,n=1000,output_file=None): | ||
cluster_densities = [] | ||
loading_concentrations = np.linspace(low,high,n) | ||
for lc in loading_concentrations: | ||
X = np.append(lc,spectra).reshape(1,-1) | ||
y = model.predict(X) | ||
cluster_densities.append(y[0]) | ||
|
||
#print(cluster_densities) | ||
plt.plot(loading_concentrations,cluster_densities) | ||
plt.title('Loading Concentration vs Predicted Cluster Density') | ||
plt.xlabel('Loading Concentration [pM]') | ||
plt.ylabel('Predicted Cluster Density [k/mm^2]') | ||
plt.xlim([low,high]) | ||
|
||
if output_file is None: | ||
plt.show() | ||
else: | ||
plt.savefig(output_file,dpi=600) | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# Installs the pipenv for running the tool. | ||
|
||
python3 -m pipenv --rm | ||
python3 -m pipenv install |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,35 +4,37 @@ def warn(*args, **kwargs): | |
import warnings | ||
tianar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
warnings.warn = warn | ||
|
||
from diva_dna_seq.utility import aproximate_sequence,prepare_data | ||
from diva_dna_seq import predict_loading_concentration | ||
from diva_seq_opt import utility | ||
import argparse | ||
import pickle | ||
|
||
|
||
def main(): | ||
#Allow Matplotlib to be used on commandline | ||
import matplotlib as mpl | ||
tianar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mpl.use('Agg') | ||
|
||
#Allow Matplotlib to be used on commandline | ||
import matplotlib as mpl | ||
mpl.use('Agg') | ||
#Handle inputs | ||
#Parse Inputs | ||
parser = argparse.ArgumentParser(description='Use BioAnalyzer Data to Predict Library Loading Concentration for Library Barcoding') | ||
|
||
#Handle inputs | ||
#Parse Inputs | ||
parser = argparse.ArgumentParser(description='Use BioAnalyzer Data to Predict Library Loading Concentration for Library Barcoding') | ||
parser.add_argument('BAF',type=str, help='BioAnalyzer CSV') | ||
parser.add_argument('LAD',type=str, help='Ladder CSV') | ||
parser.add_argument('OF' ,type=str, help='Prediction Plot output file, *.png') | ||
args = parser.parse_args() | ||
|
||
parser.add_argument('BAF',type=str, help='BioAnalyzer CSV') | ||
parser.add_argument('LAD',type=str, help='Ladder CSV') | ||
parser.add_argument('OF' ,type=str, help='Prediction Plot output file, *.png') | ||
args = parser.parse_args() | ||
#Load Model | ||
with open('./diva_seq_opt/model/model30.pkl','rb') as fp: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Later on we should change this model name to e.g. model_latest.pkl and always have a copy of the latest model. For example, at the end of the year the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I very much agree for the future! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please include a TODO about that before this line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the path for models should not be among the code but in a separate directory at the same level as notebooks. |
||
model = pickle.load(fp) | ||
|
||
#Load Model | ||
with open('../model/model30.pkl','rb') as fp: | ||
model = pickle.load(fp) | ||
#Prepare Data | ||
sample_df = utility.prepare_data(args.LAD,args.BAF) | ||
|
||
#Prepare Data | ||
sample_df = prepare_data(args.LAD,args.BAF) | ||
#Create Features | ||
state,bps = utility.aproximate_sequence(sample_df,n=10,stop=12000) | ||
|
||
#Create Features | ||
state,bps = aproximate_sequence(sample_df,n=10,stop=12000) | ||
#Predict | ||
utility.predict_loading_concentration(state,model,output_file=args.OF) | ||
|
||
#Predict | ||
predict_loading_concentration(state,model,output_file=args.OF) | ||
if __name__ == "__main__": | ||
main() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be instructions for this in README.