Permalink
Browse files

tests to test final MiXCR binary.

  • Loading branch information...
dbolotin committed Feb 5, 2017
1 parent a72dea2 commit 65d6115b7460e956d06c3b67fb454311e78e24c4
Showing with 95 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +76 −0 itests.sh
  3. +18 −4 src/main/java/com/milaboratory/mixcr/cli/ActionExportParameters.java
View
@@ -6,3 +6,4 @@ doc/_build
.floo
.flooignore
out
test_target
View
@@ -0,0 +1,76 @@
#!/bin/bash
# "Integration" tests for MiXCR
# Test standard analysis pipeline results
# Linux readlink -f alternative for Mac OS X
function readlinkUniversal() {
targetFile=$1
cd `dirname $targetFile`
targetFile=`basename $targetFile`
# iterate down a (possible) chain of symlinks
while [ -L "$targetFile" ]
do
targetFile=`readlink $targetFile`
cd `dirname $targetFile`
targetFile=`basename $targetFile`
done
# compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
phys_dir=`pwd -P`
result=$phys_dir/$targetFile
echo $result
}
os=`uname`
delta=100
dir=""
case $os in
Darwin)
dir=$(dirname "$(readlinkUniversal "$0")")
;;
Linux)
dir="$(dirname "$(readlink -f "$0")")"
;;
FreeBSD)
dir=$(dirname "$(readlinkUniversal "$0")")
;;
*)
echo "Unknown OS."
exit 1
;;
esac
rm -rf ${dir}/test_target
mkdir ${dir}/test_target
cp ${dir}/src/test/resources/sequences/*.fastq ${dir}/test_target/
cd ${dir}/test_target/
PATH=${dir}:${PATH}
which mixcr
mixcr -v
function go_assemble {
mixcr assemble -r $1.clns.report $1.vdjca $1.clns || exit 1
for c in TCR IG TRB TRA TRG TRD IGH IGL IGK ALL
do
mixcr exportClones -c ${c} -s $1.clns $1.clns.${c}.txt || exit 1
done
}
for s in sample_IGH test;
do
mixcr align -r ${s}_paired.vdjca.report ${s}_R1.fastq ${s}_R2.fastq ${s}_paired.vdjca || exit 1
go_assemble ${s}_paired
mixcr align -r ${s}_single.vdjca.report ${s}_R1.fastq ${s}_single.vdjca || exit 1
go_assemble ${s}_single
done
@@ -59,7 +59,12 @@
@Parameter(description = "Output short versions of column headers which facilitates analysis with Pandas, R/DataFrames or other data tables processing library.",
names = {"-s", "--no-spaces"})
public Boolean noSpaces = false;
@Deprecated
public Boolean noSpaces;
@Parameter(description = "Output human-readable version of column headers.",
names = {"-v", "--human-readable"})
public Boolean humanReadable;
@Parameter(description = "Output only first N records",
names = {"-n", "--limit"}, validateWith = PositiveInteger.class)
@@ -76,6 +81,10 @@ public long getLimit() {
return files.subList(1, 2);
}
public boolean isHumanReadableParameters() {
return humanReadable != null && humanReadable;
}
public String getOutputFile() {
return files.get(1);
}
@@ -134,6 +143,10 @@ public void validate() {
}
public static void parse(Class clazz, final String[] args, ActionExportParameters parameters) {
if (parameters.noSpaces != null)
System.out.println("\"-s\" / \"--no-spaces\" option is deprecated.\nScripting friendly output format now used " +
"by default.\nUse \"-v\" / \"--human-readable\" to switch back to human readable format.");
JCommander jc = new JCommander(parameters);
jc.setAcceptUnknownOptions(true);
jc.parse(cutArgs(args));
@@ -145,10 +158,11 @@ public static void parse(Class clazz, final String[] args, ActionExportParameter
add(args[args.length - 2]);
add(args[args.length - 1]);
}};
OutputMode outputMode = parameters.noSpaces ? OutputMode.ScriptingFriendly : OutputMode.HumanFriendly;
OutputMode outputMode = parameters.isHumanReadableParameters() ? OutputMode.HumanFriendly : OutputMode.ScriptingFriendly;
parameters.exporters = new ArrayList<>();
//if preset was explicitly specified
if (parameters.preset != DEFAULT_PRESET)
if (!parameters.preset.equals(DEFAULT_PRESET))
parameters.exporters.addAll(getPresetParameters(outputMode, clazz, parameters.preset));
if (parameters.presetFile != null)
@@ -157,7 +171,7 @@ public static void parse(Class clazz, final String[] args, ActionExportParameter
parameters.exporters.addAll(parseFields(outputMode, clazz, jc.getUnknownOptions()));
if (parameters.exporters.isEmpty())
parameters.exporters.addAll(getPresetParameters(outputMode, clazz, parameters.preset));
parameters.exporters.addAll(getPresetParameters(outputMode, clazz, DEFAULT_PRESET));
parameters.validate();
}

0 comments on commit 65d6115

Please sign in to comment.