Skip to content

Commit

Permalink
r486: treat "U" as "T" for RNA reads (lh3#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
lh3 committed Oct 7, 2017
1 parent 47b86e7 commit bf2d4f7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
4 changes: 4 additions & 0 deletions bseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ void mm_bseq_close(mm_bseq_file_t *fp)

static inline void kseq2bseq(kseq_t *ks, mm_bseq1_t *s, int with_qual)
{
int i;
s->name = strdup(ks->name.s);
s->seq = strdup(ks->seq.s);
for (i = 0; i < ks->seq.l; ++i) // convert U to T
if (s->seq[i] == 'u' || s->seq[i] == 'U')
--s->seq[i];
s->qual = with_qual && ks->qual.l? strdup(ks->qual.s) : 0;
s->l_seq = ks->seq.l;
}
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"

#define MM_VERSION "2.2-r482-dirty"
#define MM_VERSION "2.2-r486-dirty"

#ifdef __linux__
#include <sys/resource.h>
Expand Down
28 changes: 14 additions & 14 deletions sketch.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
#include "minimap.h"

unsigned char seq_nt4_table[256] = {
0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 3, 3,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4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
};

Expand Down
5 changes: 4 additions & 1 deletion tex/hs38-simu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ bin/mason_variator -ir hs38.fa -s 1 -ov hs38-s1.vcf --snp-rate 1e-3 --small-inde
bin/mason_simulator -ir hs38.fa -iv hs38-s1.vcf -n 1000000 --seed 1 -o s1_1.fq -or s1_2.fq -oa s1.sam --illumina-prob-mismatch-scale 2.5

bin/mason_variator -ir hs38.fa -s 2 -ov hs38-s2.vcf --snp-rate 1e-3 --small-indel-rate 2e-4 --sv-indel-rate 0 --sv-inversion-rate 0 --sv-translocation-rate 0 --sv-duplication-rate 0 --max-small-indel-size 10
bin/mason_simulator -ir hs38.fa -iv hs38-s2.vcf -n 1000000 --seed 1 -o mason-s2_1.fq -or mason-s2_2.fq -oa mason-s2.sam --illumina-prob-mismatch-scale 2.5 --illumina-read-length 150
bin/mason_simulator -ir hs38.fa -iv hs38-s2.vcf -n 1000000 --seed 2 -o mason-s2_1.fq -or mason-s2_2.fq -oa mason-s2.sam --illumina-prob-mismatch-scale 2.5 --illumina-read-length 150

bin/mason_variator -ir hs38.fa -s 3 -ov hs38-s3.vcf --snp-rate 1e-3 --small-indel-rate 2e-4 --sv-indel-rate 0 --sv-inversion-rate 0 --sv-translocation-rate 0 --sv-duplication-rate 0 --max-small-indel-size 10
bin/mason_simulator -ir hs38.fa -iv hs38-s3.vcf -n 10000000 --seed 3 -o mason-s3_1.fq -or mason-s3_2.fq -oa mason-s3.sam --illumina-prob-mismatch-scale 2.5 --illumina-read-length 150

0 comments on commit bf2d4f7

Please sign in to comment.