Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified doc/formats.pdf
Binary file not shown.
61 changes: 58 additions & 3 deletions doc/formats.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
\documentclass[10pt]{article}
\usepackage{color}
\usepackage{xcolor}
\definecolor{gray}{rgb}{0.7,0.7,0.7}
\usepackage{framed}
\usepackage{enumitem}
\usepackage{longtable}
\usepackage{adjustbox}
\usepackage[pdfborder={0 0 0},hyperfootnotes=false]{hyperref}

\addtolength{\textwidth}{3.4cm}
Expand Down Expand Up @@ -243,12 +243,67 @@ \section{.rlens.gz}
Readlength distribution. Distribution is count of alignments of
specific readlengths. Depending on runmode there might be multiple
groups as taxid/refs and there will be group specific
distributions. Distributions for different groups are split by
distributions.
\subsection{Old versions (pre april 2026)}
Distributions for different groups are split by
newlines. First entry on each line is the identifer
(chromosomename,taxid). The remaining entries are the number of times
we have observed an alignment of length (columnnumber). Notice that
the first 30 column of counts is likely to be zero since reads shorter
than 30basepairs are normally discarded.
\subsection{Newer versions: human nice format}
Each distribution is a newline. Each entry in the distribution is bin:count seperated by tab.
Example can be seen below. This is the default option that should be enforcable by \colorbox{gray!10}{\texttt{--rlens\_flat\_out 0}}. Output below is clipped at rightside and at bottom. Example shown is from one of the testfiles, and has been generated by \colorbox{gray!10}{\texttt{cut -c1-80 test/output/test\_getdamage\_local.rlens|head }}
\begin{framed}
\small
\begin{verbatim}
id rlen:count
0 35:33 36:29 37:24 38:38 39:24 40:29 41:36 42:28 43:27 44:36 45:29 46:23 47:32...
1 35:103 36:106 37:102 38:111 39:109 40:126 41:125 42:164 43:154 44:133 45:152...
2 35:35 36:44 37:28 38:41 39:33 40:36 41:41 42:33 43:34 44:43 45:41 46:36 47:40...
3 35:36 36:39 37:25 38:37 39:29 40:34 41:39 42:33 43:34 44:43 45:41 46:33 47:39...
4 35:100 36:98 37:95 38:112 39:107 40:136 41:127 42:161 43:157 44:138 45:134 46:...
5 35:92 36:118 37:110 38:125 39:129 40:168 41:158 42:164 43:195 44:180 45:177 46...
6 35:95 36:130 37:111 38:125 39:129 40:178 41:167 42:148 43:196 44:193 45:185 46...
7 35:138 36:145 37:131 38:125 39:147 40:179 41:190 42:205 43:196 44:201 45:220 4...
8 35:95 36:132 37:113 38:137 39:133 40:182 41:162 42:176 43:196 44:190 45:189 46...
...
\end{verbatim}
\end{framed}
\subsection{Newer versions: human nice format}


The parsing of the standard output rlens file can be abit confusing for programs to parse due to the varying columnwidth. Therefore by supplying \colorbox{gray!10}{\texttt{--rlens\_flat\_out 1}} or \colorbox{gray!10}{\texttt{-z 1}} in relevant commands the output will be flattened in to a simpler but longer format.
\begin{framed}
\small
\begin{verbatim}
IFILE=./data/f570b1db7c.dedup.filtered.rname.bam
../metaDMG-cpp getdamage -r 1 -l 35 -p 5 -o output/test_getdamage_local ${IFILE} -z 1
gunzip -c output/test_getdamage_local.rlens.gz|head -n20
##below is the output from the last command above
ID rlen count
0 35 33
0 36 29
0 37 24
0 38 38
0 39 24
0 40 29
0 41 36
0 42 28
0 43 27
0 44 36
0 45 29
0 46 23
0 47 32
0 48 23
0 49 25
0 50 17
0 51 16
0 52 19
0 53 17
\end{verbatim}
\end{framed}

\end{document}

%%% Local Variables:
Expand Down
5 changes: 3 additions & 2 deletions main_dfit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "dfit_helppage.h"
#include "mrand.h"

extern htsFormat *dingding2;
//extern htsFormat *dingding2;

// the compare function for double values
static int compare (const void * a, const void * b)
Expand Down Expand Up @@ -672,6 +672,7 @@ int main_dfit(int argc, char **argv) {
double CI = 0.95;
int doCI = 2;
int rng_type = -1;
htsFormat *dingding2 = (htsFormat *)calloc(1, sizeof(htsFormat));
while (*(++argv)) {
if (strcasecmp("-h", *argv) == 0)
HelpPageSimple(stderr);
Expand Down Expand Up @@ -947,7 +948,7 @@ int main_dfit(int argc, char **argv) {
free(outfile_name);
if(lib_prep)
free(lib_prep);

free(dingding2);
gettimeofday(&end_time, NULL);
long seconds = end_time.tv_sec - start_time.tv_sec;
long microseconds = end_time.tv_usec - start_time.tv_usec;
Expand Down
7 changes: 4 additions & 3 deletions main_pmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

#include "profile.h" // for reconstructRefWithPosHTS

extern htsFormat *dingding2;
htsFormat *dingding3 = dingding2;
//extern htsFormat *dingding2;
//htsFormat *dingding3 = dingding2;


int nproc = 0; // number of reads processed
Expand Down Expand Up @@ -159,7 +159,7 @@ void parse_sequencingdata(char *refName, char *fname, int mapped_only, int se_on
kstr->s = NULL;
mypair.first = kstr;
samFile *in = NULL;

htsFormat *dingding3 = (htsFormat *)calloc(1, sizeof(htsFormat));
if (refName) {
char *ref = (char *)malloc(10 + strlen(refName) + 1);
snprintf(ref,10 + strlen(refName) + 1, "reference=%s", refName);
Expand Down Expand Up @@ -241,6 +241,7 @@ void parse_sequencingdata(char *refName, char *fname, int mapped_only, int se_on
sam_hdr_destroy(hdr);
sam_close(in);
free(fname);
free(dingding3);
}

int usage(FILE *fp, int val) {
Expand Down
Loading
Loading