Skip to content

Commit

Permalink
added prefix argument two motifGrammar and EmptyBackground scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-bond committed Jan 22, 2018
1 parent 2083d7e commit a6f0bd0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion scripts/emptyBackground.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

def do(options):
outputFileName_core = util.addArguments("EmptyBackground", [
util.ArgumentToAdd(options.prefix, "prefix"),
util.ArgumentToAdd(options.seqLength, "seqLength")
,util.ArgumentToAdd(options.numSeqs, "numSeqs")
])
Expand All @@ -15,10 +16,12 @@ def do(options):
, embedders=[]
);
sequenceSet = sn.GenerateSequenceNTimes(embedInBackground, options.numSeqs)
sn.printSequences(outputFileName_core+".simdata", sequenceSet, includeFasta=True, includeEmbeddings=True)
sn.printSequences(outputFileName_core+".simdata", sequenceSet, includeFasta=True, includeEmbeddings=True,
prefix=options.prefix)

if __name__=="__main__":
parser = argparse.ArgumentParser();
parser.add_argument("--prefix")
parser.add_argument("--seqLength", type=int, required=True)
parser.add_argument("--numSeqs", type=int, required=True)
options = parser.parse_args()
Expand Down
6 changes: 4 additions & 2 deletions scripts/motifGrammarSimulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def motifGrammarSimulation(options):
seqLength = options.seqLength
numSeq = options.numSeq
generationSetting = options.generationSetting
outputFileName = "motifGrammarSimulation_"+generationSetting+("_bestHit" if bestHit else "")
outputFileName = "motifGrammarSimulation_"+("prefix-"+options.prefix+"_" if options.prefix is not None else "")+generationSetting+("_bestHit" if bestHit else "")
if (generationSetting is not generationSettings.singleMotif2):
outputFileName+="_motif1-"+motifName1
if (generationSetting is not generationSettings.singleMotif1):
Expand Down Expand Up @@ -89,11 +89,13 @@ def motifGrammarSimulation(options):

sequenceSet = synthetic.GenerateSequenceNTimes(embedInBackground, numSeq)
synthetic.printSequences(outputFileName, sequenceSet,
includeFasta=True, includeEmbeddings=True)
includeFasta=True, includeEmbeddings=True,
prefix=options.prefix)

if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--prefix")
parser.add_argument("--pathToMotifs",
default=simdna.ENCODE_MOTIFS_PATH)
parser.add_argument("--motifName1", required=True)
Expand Down
2 changes: 1 addition & 1 deletion scripts_test/test_empty_background_script.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

emptyBackground.py --seqLength 200 --numSeqs 10
emptyBackground.py --prefix empty --seqLength 200 --numSeqs 10
2 changes: 1 addition & 1 deletion scripts_test/test_motif_grammar_simulation_script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#variable spacing
motifGrammarSimulation.py --motifName1 TAL1_known1 --motifName2 GATA_disc2 --seqLength 200 --numSeq 10 --generationSetting twoMotifsVariableSpacing --fixedSpacingOrMinSpacing 1 --maxSpacing 5
motifGrammarSimulation.py --prefix testprefix --motifName1 TAL1_known1 --motifName2 GATA_disc2 --seqLength 200 --numSeq 10 --generationSetting twoMotifsVariableSpacing --fixedSpacingOrMinSpacing 1 --maxSpacing 5

#variable spacing best hit
motifGrammarSimulation.py --motifName1 TAL1_known1 --motifName2 GATA_disc2 --bestHit --seqLength 200 --numSeq 100 --generationSetting twoMotifsVariableSpacing --fixedSpacingOrMinSpacing 1 --maxSpacing 5
Expand Down

0 comments on commit a6f0bd0

Please sign in to comment.