Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Patro committed Jul 23, 2021
2 parents 633cf1d + 96ea980 commit fe11990
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 59 deletions.
2 changes: 1 addition & 1 deletion current_version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION_MAJOR 1
VERSION_MINOR 5
VERSION_PATCH 1
VERSION_PATCH 2
4 changes: 2 additions & 2 deletions doc/source/alevin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ values here can speed up the run substantially. In our testing we found that usu

This is an optional argument, where user can explicitly specify the whitelist CB to use for cell detection and CB sequence correction. If not given, alevin generates its own set of putative CBs.

.. note:: Not 10x 724k whitelist
.. note:: Not 10x 737k whitelist

This flag does not use the biologically known whitelist provided by 10x, instead it's per experiment level whitelist file e.g. the file generated by cellranger with the name `barcodes.tsv`.
This flag does not use the technologically defined whitelisted cellular barcodes provided by 10x, instead it's a per experiment level list of subsampled cellular barcodes that need to quantified for consistency with other tools for example an input would be a file generated by cellranger with the name `barcodes.tsv` (uncompressed).

""""""""""""
``--noQuant``
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# The short X.Y version.
version = '1.5'
# The full version, including alpha/beta/rc tags.
release = '1.5.1'
release = '1.5.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAINTAINER salmon.maintainer@gmail.com

ENV PACKAGES git gcc make g++ libboost-all-dev liblzma-dev libbz2-dev \
ca-certificates zlib1g-dev libcurl4-openssl-dev curl unzip autoconf apt-transport-https ca-certificates gnupg software-properties-common wget
ENV SALMON_VERSION 1.5.1
ENV SALMON_VERSION 1.5.2

# salmon binary will be installed in /home/salmon/bin/salmon

Expand Down
2 changes: 1 addition & 1 deletion docker/build_test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /bin/bash
SALMON_VERSION=1.5.1
SALMON_VERSION=1.5.2
docker build --no-cache -t combinelab/salmon:${SALMON_VERSION} -t combinelab/salmon:latest .
3 changes: 3 additions & 0 deletions include/GZipWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class GZipWriter {
template <typename ExpT>
bool writeMeta(const SalmonOpts& opts, const ExpT& experiment, const MappingStatistics& mstats);

template <typename SCExpT>
bool writeMetaFryMode(const SalmonOpts& opts, const SCExpT& experiment, const MappingStatistics& mstats);

template <typename ProtocolT>
bool writeMetaAlevin(const AlevinOpts<ProtocolT>& opts,
boost::filesystem::path aux_dir);
Expand Down
8 changes: 4 additions & 4 deletions include/SalmonConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Sailfish is distributed in the hope that it will be useful,
Salmon is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Sailfish. If not, see <http://www.gnu.org/licenses/>.
along with Salmon. If not, see <http://www.gnu.org/licenses/>.
<HEADER
**/

Expand All @@ -27,8 +27,8 @@
namespace salmon {
constexpr char majorVersion[] = "1";
constexpr char minorVersion[] = "5";
constexpr char patchVersion[] = "1";
constexpr char version[] = "1.5.1";
constexpr char patchVersion[] = "2";
constexpr char version[] = "1.5.2";
constexpr uint32_t indexVersion = 5;
constexpr char requiredQuasiIndexVersion[] = "p7";
} // namespace salmon
Expand Down
133 changes: 94 additions & 39 deletions include/concurrentqueue.h

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion include/cuckoohash_map.hh
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,9 @@ private:
// true if the key is small and simple, which means using partial keys for
// lookup would probably slow us down
static constexpr bool is_simple() {
return std::is_pod<key_type>::value && sizeof(key_type) <= 8;
return std::is_standard_layout<key_type>::value &&
std::is_trivial<key_type>::value &&
sizeof(key_type) <= 8;
}

// Whether or not the data is nothrow-move-constructible.
Expand Down
4 changes: 2 additions & 2 deletions scripts/fetchPufferfish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ if [ -d ${INSTALL_DIR}/src/pufferfish ] ; then
rm -fr ${INSTALL_DIR}/src/pufferfish
fi

SVER=salmon-v1.5.1
SVER=salmon-v1.5.2
#SVER=develop
#SVER=sketch-mode

EXPECTED_SHA256=468e0c23a32d81524f7acadc8326efb155628970c15fd6cb843d26a61478bfde
EXPECTED_SHA256=86c7ff465d40b8184dca7f6afee693ad1db63be5bf63242161ea39d3507d6d25

mkdir -p ${EXTERNAL_DIR}
curl -k -L https://github.com/COMBINE-lab/pufferfish/archive/${SVER}.zip -o ${EXTERNAL_DIR}/pufferfish.zip
Expand Down
17 changes: 13 additions & 4 deletions src/Alevin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,14 +890,24 @@ void initiatePipeline(AlevinOpts<ProtocolT>& aopt,

if (aopt.just_align) {
// if we are just aligning

// write out the cmd_info.json to make sure we have that
boost::filesystem::path outputDirectory = vm["output"].as<std::string>();
bool isWriteOk = aut::writeCmdInfo(outputDirectory / "cmd_info.json", orderedOptions);
if(!isWriteOk){
fmt::print(stderr, "Writing cmd_info.json in output directory failed.\nExiting now.");
exit(1);
}

// do the actual mapping
auto rc = alevin_sc_align(aopt, sopt, orderedOptions);

if (rc == 0) {
aopt.jointLog->info("sc-align successful.");
std::exit(0);
} else {
aopt.jointLog->error("sc-align exited with return code {}", rc);
std::exit(rc);
}
std::exit(rc);
}

/*
Expand Down Expand Up @@ -946,7 +956,7 @@ void initiatePipeline(AlevinOpts<ProtocolT>& aopt,
// Write out information about the command / run
bool isWriteOk = aut::writeCmdInfo(cmdInfoPath / "cmd_info.json", orderedOptions);
if(!isWriteOk){
fmt::print(stderr, "writing in output directory failed\n Exiting Now");
fmt::print(stderr, "Writing cmd_info.json in output directory failed.\nExiting now.");
exit(1);
}
}
Expand Down Expand Up @@ -1010,7 +1020,6 @@ salmon-based processing of single-cell RNA-seq data.
green[3] = '0' + static_cast<char>(fmt::GREEN);
red[3] = '0' + static_cast<char>(fmt::RED);


bool noTgMap {false};
bool dropseq = vm["dropseq"].as<bool>();
bool indrop = vm["indrop"].as<bool>();
Expand Down
83 changes: 83 additions & 0 deletions src/GZipWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,84 @@ bool GZipWriter::writeMeta(const SalmonOpts& opts, const ExpT& experiment, const
return true;
}

/**
* Write the ``main'' metadata to file when executing in alevin-fry mode. Currently this
* writes a stripped down version of meta_info.json:
* -- A json file with information about the run
*/
template <typename ExpT>
bool GZipWriter::writeMetaFryMode(const SalmonOpts& opts, const ExpT& experiment, const MappingStatistics& mstats) {

namespace bfs = boost::filesystem;
using salmon::utils::DuplicateTargetStatus;

bfs::path auxDir = path_ / opts.auxDir;
bool auxSuccess = boost::filesystem::create_directories(auxDir);
auto numBootstraps = 0;
auto numSamples = 0;

bfs::path info = auxDir / "meta_info.json";
{
std::ofstream os(info.string());
cereal::JSONOutputArchive oa(os);

std::string sampType = "none";
auto& transcripts = experiment.transcripts();
oa(cereal::make_nvp("salmon_version", std::string(salmon::version)));
oa(cereal::make_nvp("samp_type", sampType));

std::string optType = "rad_mode";
oa(cereal::make_nvp("opt_type", optType));

std::vector<std::string> errors;
oa(cereal::make_nvp("quant_errors", errors));

auto libStrings = getLibTypeStrings(experiment);
oa(cereal::make_nvp("num_libraries", libStrings.size()));
oa(cereal::make_nvp("library_types", libStrings));

auto has_dups = experiment.index_retains_duplicates();
switch(has_dups) {
case DuplicateTargetStatus::RETAINED_DUPLICATES:
oa(cereal::make_nvp("keep_duplicates", true));
break;
case DuplicateTargetStatus::REMOVED_DUPLICATES:
oa(cereal::make_nvp("keep_duplicates", false));
break;
case DuplicateTargetStatus::UNKNOWN:
default:
break;
}

auto numValidTargets = transcripts.size();
auto numDecoys = experiment.getNumDecoys();
oa(cereal::make_nvp("num_valid_targets", numValidTargets));
oa(cereal::make_nvp("num_decoy_targets", numDecoys));

oa(cereal::make_nvp("length_classes", experiment.getLengthQuantiles()));
oa(cereal::make_nvp("index_seq_hash", experiment.getIndexSeqHash256()));
oa(cereal::make_nvp("index_name_hash", experiment.getIndexNameHash256()));
oa(cereal::make_nvp("index_seq_hash512", experiment.getIndexSeqHash512()));
oa(cereal::make_nvp("index_name_hash512", experiment.getIndexNameHash512()));
oa(cereal::make_nvp("index_decoy_seq_hash", experiment.getIndexDecoySeqHash256()));
oa(cereal::make_nvp("index_decoy_name_hash", experiment.getIndexDecoyNameHash256()));
oa(cereal::make_nvp("num_bootstraps", numSamples));
oa(cereal::make_nvp("num_processed", experiment.numObservedFragments()));
oa(cereal::make_nvp("num_mapped", experiment.numMappedFragments()));
//oa(cereal::make_nvp("num_decoy_fragments", mstats.numDecoyFragments.load()));
//oa(cereal::make_nvp("num_dovetail_fragments", mstats.numDovetails.load()));
oa(cereal::make_nvp("num_fragments_filtered_vm", mstats.numFragmentsFiltered.load()));
oa(cereal::make_nvp("num_alignments_below_threshold_for_mapped_fragments_vm",
mstats.numMappingsFiltered.load()));
//oa(cereal::make_nvp("percent_mapped",
// experiment.effectiveMappingRate() * 100.0));
oa(cereal::make_nvp("call", std::string("quant")));
oa(cereal::make_nvp("start_time", opts.runStartTime));
oa(cereal::make_nvp("end_time", opts.runStopTime));
}
return true;
}

bool GZipWriter::writeAbundances(
std::vector<double>& alphas,
std::vector<Transcript>& transcripts) {
Expand Down Expand Up @@ -1730,6 +1808,11 @@ GZipWriter::writeMeta<SCExpT>(const SalmonOpts& opts,
const SCExpT& experiment,
const MappingStatistics& mstats);

template bool
GZipWriter::writeMetaFryMode<SCExpT>(const SalmonOpts& opts,
const SCExpT& experiment,
const MappingStatistics& mstats);

template bool
GZipWriter::writeMeta<BulkAlignLibT<UnpairedRead,AlignmentModel>>(const SalmonOpts& opts, const BulkAlignLibT<UnpairedRead,AlignmentModel>& experiment,
const MappingStatistics& mstats);
Expand Down
11 changes: 8 additions & 3 deletions src/SalmonAlevin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,7 @@ void do_sc_align(ReadExperimentT& experiment,
}



BasicBinWriter bw;
// RADHeader
RADHeader rh;
Expand Down Expand Up @@ -2667,8 +2668,8 @@ int alevin_sc_align(AlevinOpts<ProtocolT>& aopt,
using std::string;
namespace bfs = boost::filesystem;
namespace po = boost::program_options;
try{
//auto fileLog = sopt.fileLog;

try {
auto jointLog = aopt.jointLog;
auto indexDirectory = sopt.indexDirectory;
auto outputDirectory = sopt.outputDirectory;
Expand Down Expand Up @@ -2748,6 +2749,11 @@ int alevin_sc_align(AlevinOpts<ProtocolT>& aopt,

do_sc_align<QuasiAlignment>(experiment, sopt,
mstats, sopt.numThreads, aopt);

// write meta-information about the run
GZipWriter gzw(outputDirectory, jointLog);
sopt.runStopTime = salmon::utils::getCurrentTimeAsString();
gzw.writeMetaFryMode(sopt, experiment, mstats);
} catch (po::error& e) {
std::cerr << "Exception : [" << e.what() << "]. Exiting.\n";
std::exit(1);
Expand All @@ -2761,7 +2767,6 @@ int alevin_sc_align(AlevinOpts<ProtocolT>& aopt,
<< " alevin --help\nExiting.\n";
std::exit(1);
}

return 0;
}

Expand Down

0 comments on commit fe11990

Please sign in to comment.