Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 49bf399a9d1ceae722c0c8c4aeb8376f2644d40f authored by Asher Preska Steinberg on 07 February 2022, 16:12:20 UTC, committed by Asher Preska Steinberg on 07 February 2022, 16:12:20 UTC
Commit for ReduceCoreGenome
1 parent 86759f7
  • Files
  • Changes
  • c9e6ce9
  • /
  • ConvertMap.sh
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:49bf399a9d1ceae722c0c8c4aeb8376f2644d40f
directory badge Iframe embedding
swh:1:dir:c9e6ce9963a2ebfadbbb0748f635ce8c69aa90ec
content badge Iframe embedding
swh:1:cnt:3736a0f13568bf0a3f382e0a344c67b0254b5f1c
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
ConvertMap.sh
#!/bin/bash
# This script maps reads to the reference genome to generate the consensus genomic sequence.
# Created by Asher Preska Steinberg (apsteinberg@nyu.edu) based on scripts by Mingzhi Lin (mingzhi9@gmail.com)
# It requires samtools (https://github.com/samtools/samtools) and smalt (http://www.sanger.ac.uk/science/tools/smalt-0).
# this version is advantageous to the previous for larger datasets where FASTQs take up a prohibitive amount of disk space
# Inputs:
#   (1) the accession list file;
#   (2) the working directory;
#   (3) the reference genome.
#   (4) number of threads given to mapping/compression from sam to bam
# Output:
#   the consensus genomic sequences in FASTA format.

function map2reference {
    READ=$1
    WORKING_DIR=$2
    REFERENCE=$3
    LABEL=pileup
    sra_file=${WORKING_DIR}/${READ}/${READ}.sra
    prefetch ${READ}
    fastq-dump -O ${WORKING_DIR} --split-3 ${sra_file}
    smalt map -n 1 ${REFERENCE} ${WORKING_DIR}/${READ}_1.fastq ${WORKING_DIR}/${READ}_2.fastq | \
        samtools sort -T /tmp -o ${WORKING_DIR}/${READ}.sorted.bam
        samtools mpileup -f ${REFERENCE} ${WORKING_DIR}/${READ}.sorted.bam | \
        GenomicConsensus --fna_file ${REFERENCE} > ${WORKING_DIR}/${READ}.${LABEL}.fasta
        rm ${WORKING_DIR}/${READ}.sorted.bam
        rm ${WORKING_DIR}/${READ}_1.fastq
        rm ${WORKING_DIR}/${READ}_2.fastq
        rm -f ${WORKING_DIR}/${READ}.fastq
        rm -r ${WORKING_DIR}/${READ}
}

export -f map2reference

accession_list_file=$1
working_dir=$2
reference=$3
smalt index ${reference} ${reference}
samtools faidx ${reference}
cd ${working_dir}
parallel map2reference {} ${working_dir} ${reference} :::: ${accession_list_file}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top