Skip to content

Commit

Permalink
Merge branch 'release/v2.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Nov 27, 2017
2 parents 012adab + a14792f commit fcd2b73
Show file tree
Hide file tree
Showing 33 changed files with 1,091 additions and 333 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@

MiXCR 2.1.6 (28 Nov 2017)
========================

-- *(beta)* Added JSON-formatted reports. Use `--json-report` option in `align`,
`extendAlignments`, `assemblePartial` or `assemble` actions to create JSON report or append it to
already existing report file ([jsonl](http://jsonlines.org/)). This feature is intended to simplify
batch analysis, and analysis automation. E.g. [jq](https://stedolan.github.io/jq/) util can be used
to aggregate information from multi-json-report files.
-- Report file appends are made atomic. Now you can safely specify the same report file name in
several invocations of MiXCR, even if you run several instances of MiXCR in parallel. Should also
work for NFS and other remote FS, suppporting file locking.
-- Added chains column in export (`-chains` and `-topChains`)
-- minor: Several new counters added to `align` report
-- minor: Added proper filtering for alleles with wildcard symbols in `featureToAlign` region
-- minor: Fixed bug in align report (wrong total count in rare cases) #265
-- minor: Documentation added for `filterAlignments`


MiXCR 2.1.5 (24 Jul 2017)
========================

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ PATENT, TRADEMARK OR OTHER RIGHTS.

## Cite

Bolotin, Dmitriy A., Stanislav Poslavsky, Igor Mitrophanov, Mikhail Shugay, Ilgar Z. Mamedov, Ekaterina V. Putintseva, and Dmitriy M. Chudakov. "MiXCR: software for comprehensive adaptive immunity profiling." *Nature methods* 12, no. 5 (**2015**): 380-381.
* Dmitriy A. Bolotin, Stanislav Poslavsky, Igor Mitrophanov, Mikhail Shugay, Ilgar Z. Mamedov, Ekaterina V. Putintseva, and Dmitriy M. Chudakov. "MiXCR: software for comprehensive adaptive immunity profiling." *Nature methods* 12, no. 5 (**2015**): 380-381.

* Dmitriy A. Bolotin, Stanislav Poslavsky, Alexey N. Davydov, Felix E. Frenkel, Lorenzo Fanchi, Olga I. Zolotareva, Saskia Hemmers, Ekaterina V. Putintseva, Anna S. Obraztsova, Mikhail Shugay, Ravshan I. Ataullakhanov, Alexander Y. Rudensky, Ton N. Schumacher & Dmitriy M. Chudakov. "Antigen receptor repertoire profiling from RNA-seq data." *Nature Biotechnology* 35, 908–911 (**2017**)

## Files referenced in original paper

Expand Down
272 changes: 143 additions & 129 deletions doc/ExportFieldsVDJCObject.rst

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ MiXCR is free for academic and non-profit use (see :ref:`License <license>`).

*MiXCR pipeline. The workflow from IG or T-cell receptor data sets to final clonotypes is shown*

:ref:`getting-started`
:ref:`main-actions`
:ref:`special-cases`
:ref:`in-depth-topics`

.. _getting-started:

.. toctree::
Expand Down
28 changes: 28 additions & 0 deletions doc/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,31 @@ Allows to merge multiple ``.vdjca`` files into a single one:
> mixcr mergeAlignments file1.vdjca file2.vdjca ... output.vdjca


Filter alignments
-----------------

Allows to filter alignments in ``.vdjca`` file. Example:

::

> mixcr filterAlignments --chains TRA,TRB input_file.vdjca output_file.vdjca

The available options are:

+--------------------------------+-------------------------------------------------------------------------------------------------+
| Option | Description |
+================================+=================================================================================================+
| ``-e``, ``--cdr3-equals`` | Include only those alignments which CDR3 equals to a specified nucleotide sequence |
+--------------------------------+-------------------------------------------------------------------------------------------------+
| ``c``, ``--chains`` | Include only alignments with specified immunological protein chains (comma separated list |
| | of some of IGH, IGL, IGK, TRA, TRB, TRG, TRD chains) |
+--------------------------------+-------------------------------------------------------------------------------------------------+
| ``-x``, ``--chimeras-only`` | Output only chimeric alignments |
+--------------------------------+-------------------------------------------------------------------------------------------------+
| ``-g``, ``--contains-feature`` | Include only those alignments that contain specified gene feature (see :ref:`ref-geneFeatures`) |
+--------------------------------+-------------------------------------------------------------------------------------------------+
| ``-i``, ``--read-ids`` | Output alignments with specified IDs only |
+--------------------------------+-------------------------------------------------------------------------------------------------+
| ``-n``, ``--limit`` | Maximal number of alignments to process |
+--------------------------------+-------------------------------------------------------------------------------------------------+

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<groupId>com.milaboratory</groupId>
<artifactId>mixcr</artifactId>
<version>2.1.5</version>
<version>2.1.6</version>
<packaging>jar</packaging>
<name>MiXCR</name>

Expand Down
120 changes: 120 additions & 0 deletions src/main/java/com/milaboratory/mixcr/cli/AbstractActionReport.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
/*
* Copyright (c) 2014-2017, Bolotin Dmitry, Chudakov Dmitry, Shugay Mikhail
* (here and after addressed as Inventors)
* All Rights Reserved
*
* Permission to use, copy, modify and distribute any part of this program for
* educational, research and non-profit purposes, by non-profit institutions
* only, without fee, and without a written agreement is hereby granted,
* provided that the above copyright notice, this paragraph and the following
* three paragraphs appear in all copies.
*
* Those desiring to incorporate this work into commercial products or use for
* commercial purposes should contact the Inventors using one of the following
* email addresses: [email protected], [email protected]
*
* IN NO EVENT SHALL THE INVENTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
* SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
* ARISING OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE INVENTORS HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* THE SOFTWARE PROVIDED HEREIN IS ON AN "AS IS" BASIS, AND THE INVENTORS HAS
* NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
* MODIFICATIONS. THE INVENTORS MAKES NO REPRESENTATIONS AND EXTENDS NO
* WARRANTIES OF ANY KIND, EITHER IMPLIED OR EXPRESS, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
* PARTICULAR PURPOSE, OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY
* PATENT, TRADEMARK OR OTHER RIGHTS.
*/
package com.milaboratory.mixcr.cli;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.milaboratory.mixcr.util.MiXCRVersionInfo;
import com.milaboratory.util.TimeUtils;

import java.util.Date;

public abstract class AbstractActionReport implements ActionReport {
private Date date = new Date();
private String commandLine;
private String[] inputFiles, outputFiles;
private long startMillis, finishMillis;

@JsonProperty("timestamp")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss.SSSZ")
public Date getDate() {
return date;
}

@JsonProperty("commandLine")
public String getCommandLine() {
return commandLine;
}

@JsonProperty("inputFiles")
public String[] getInputFiles() {
return inputFiles;
}

@JsonProperty("outputFiles")
public String[] getOutputFiles() {
return outputFiles;
}

@JsonProperty("executionTimeMillis")
public long getExecutionTimeMillis() {
return finishMillis - startMillis;
}

@JsonProperty("version")
public String getVersion() {
return MiXCRVersionInfo.get().getShortestVersionString();
}

public void setCommandLine(String commandLine) {
this.commandLine = commandLine;
}

public void setInputFiles(String... inputFiles) {
this.inputFiles = inputFiles;
}

public void setOutputFiles(String... outputFiles) {
this.outputFiles = outputFiles;
}

public void setStartMillis(long startMillis) {
this.startMillis = startMillis;
}

public void setFinishMillis(long finishMillis) {
this.finishMillis = finishMillis;
}

private static String join(String[] strs) {
StringBuilder builder = new StringBuilder();
for (int i = 0; ; ++i) {
builder.append(strs[i]);
if (i == strs.length - 1)
break;
builder.append(',');
}
return builder.toString();
}

public void writeSuperReport(ReportHelper helper) {
if (!helper.isStdout())
helper.writeField("Analysis Date", getDate())
.writeField("Input file(s)", join(getInputFiles()))
.writeField("Output file(s)", join(getOutputFiles()))
.writeField("Version", getVersion());

if (!helper.isStdout())
if (getCommandLine() != null)
helper.writeField("Command line arguments", getCommandLine());

if (getExecutionTimeMillis() >= 0)
helper.writeField("Analysis time", TimeUtils.nanoTimeToString(getExecutionTimeMillis() * 1000_000));
}
}
Loading

0 comments on commit fcd2b73

Please sign in to comment.