notes.txt 9.51 KB
Newer Older
1
To-do:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
* [!] Additions needed for publication:
  * [If not too difficult to implement] BGEstimate should start with homozygous
    samples and add heterozygous samples later to optimise correction.
  * Summary statistics for BGEstimate based on top N genotypes per marker,
    which is the highest percentage remaining background in reference database
    (maybe also additional value for confidence interval).
  * Visualisation to display highest remaining background (positive and
    negative) in known samples after BGCorrect analysis.
* Update bundled D3 to v3.5.12 (now at v3.5.10)
* Libconvert should check whether the reference sequence is the same as one of
  the aliases when converting to TSSV format, because it includes the Amel-X
  allele twice now.
* Add options to Libconvert to generate a template for STR or non-STR markers.
* BGPredict's get_relative_frequencies may produce a "RuntimeWarning: invalid
  value encountered in double_scalars" when computing (with n=0):
  A[C[i]] *= stutters[i]["amount"] / A[C[i]].sum()
* BGCorrect might perform better if it 'is given a way out' for those cases
  where a sample contains a genuine allele that does not occur in the noise
  profiles. I could try to add an all-zero (except for the 100) noise profile
  for those missing sequences.
* Warn user in BGEstimate if no samples are given.
23
24
* Known bug: regex_longest_match does not give the longest match if a shorter
  match is possible and found earlier at the same position.
25
26
* Allow loading multiple files into HTML visualisations and provide prev/next
  buttons to browse them.
27
28
29
30
31
32
* Add sequence format options back to Samplestats (it turns out to be the only
  tool without them).
* In HTML visualisations, before changing a signal value, check whether the
  page is scrolled all the way to the right and if so, make sure to scroll to
  the right after the change as well.
* Add tool that takes a configuration file and runs a pipeline of other tools.
33
34
35
36
37
38
* Add tool to summarise various statistics about the entire analysis pipeline:
  (TODO: Write this list)
* Add "allow_N" flag to [no_repeat] markers.  If the flag is specified, the
  reference sequence may contain Ns.  People might need this for the rCRS mtDNA
  reference sequence.
* Samplevis:
39
40
41
  * Add % of marker to graph filtering options.
  * Add button to clear userSelected/userRemoved.
  * Vega's sorting seems to be broken (v2.4.1).
42
  * Sort STR alleles by length.
43
44
  * Option to save the marker tables to a TSV file.
  * When we have them, add default values to table filtering (for reference).
45
46
47
* Visualisations in IE10:
  * Printing striped table rows does not seem to work. (But pagebreaks work
    better than Chrome!!)
48
* Add a print stylesheet for the other visualisations (only Samplevis has one).
49
50
51
52
53
54
55
56
57
58
59
60
* Adjust BGEstimate so that it computes forward and reverse in one go.  To do
  this, double the number of columns in P and C and put the forward profile in
  the left half and the reverse profile in the right half.  The benefit of this
  is that this ensures the same A is used for both strands, that is, the
  estimated allele balance is the same.
* Adjust BGEstimate so that it takes strand bias in the allele itself into
  account as well.
* Perhaps there should be a version of BGEstimate that makes a profile for each
  genotype instead of each allele.  This allows for the detection of hybrids.
* Add plotting of raw data points to StuttermodelVis.
* Add visualisation with all markers in one graph ("samplesummaryvis"?).

Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
61
Open Vega issues:
62
63
64
65
* Feature request: Id-based refs for Force transform's source and target.
  https://github.com/vega/vega/issues/471
* Tick labels of log scale axes don't respect number formatting.
  https://github.com/vega/vega/issues/470
Hoogenboom, Jerry's avatar
Hoogenboom, Jerry committed
66
67
68
69
* Legend and axis corruption on signal changes.
  https://github.com/vega/vega/issues/446
* Feature request for lines (or arbitrary shapes) for legend items.
  https://github.com/vega/vega/issues/408
70
71
72
73


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Inclusion of tools developed during the project into FDSTools:
PRIO    OLD TOOL NAME       DESCRIPTION
------- ------------------- ---------------------------------------------------
LOW     distance-plot       Check stability of profiles by subsampling
LOW     qq-plot             Draw Q-Q plot vs normal/lognormal distributions
LOW     stuttercheck        Sort-of stuttermodel using profiles as input
LOW     substitutioncheck   Sort-of substitutionmodel using profiles as input
DONE    gen-allele-names    Convert TSSV-style sequences to allelenames
DONE    stuttermark         Mark stutter products in sample
DONE    analyze-background  BGEstimate: generate background profiles
DONE    profilemark         BGCorrect: find and correct for noise in samples
DONE    gen-bg-profiles     Compute statistics on noise in homozygous samples
DONE    blame               Find dirty samples in the reference database
DONE    allelenames-update  Convert allele names from one library to another
DONE    polyfit-repeat-len  Stuttermodel: predict stutter from sequence
DONE    common-background   Compute noise ratios in homozygous samples
DROP    alleles-convert     Convert allele names using lookup table
DROP    block-dedup         Remove duplicate blocks in TSSV-style sequences
DROP    graphgen            Create bar graph from a sample's data
DROP    find-true-alleles   Check whether the true alleles are detected
DROP    allele-graph        Create a graph of allele co-occurrence
DROP    ambiguity           Find potentially ambiguous allele combinations
DROP    strandbias          Find strand bias in the data
DROP    annotate-alleles    Annotate true alleles in sample based on allelelist

Visualisations:
LOW     blame               Common alleles
LOW     qqplot              Q-Q plot of normal/lognormal distribution
LOW     stability           Profile distance vs amount of subsampling
DONE    samplevis           Sample data
DONE    profiles            Background profiles
DONE    bg                  Dotplots of noise ratios in homozygous samples
jhoogenboom's avatar
jhoogenboom committed
106
DONE    trends              Fit repeat length vs stutter amount
107
DONE    allelegraph         Homozygosity/heterozygosity
108
109
110
111

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Argument group order:
112
input file options          bgcorrect,samplestats,seqconvert,stuttermark
113
114
115
116
117
118
output file options         allelefinder,bgcorrect,bgestimate,bghomraw,bghomstats,bgmerge,blame,samplestats,seqconvert,stuttermark,stuttermodel
sample tag parsing options  allelefinder,bgcorrect,bgestimate,bghomraw,bghomstats,blame,samplestats,seqconvert,stuttermark,stuttermodel
allele detection options    bgestimate,bghomraw,bghomstats,blame,stuttermodel
interpretation options      samplestats
filtering options           allelefinder,bgcorrect,bgestimate,bghomraw,bghomstats,bgpredict,blame,samplestats,stuttermark,stuttermodel
sequence format options     allelefinder,bgcorrect,bgestimate,bghomraw,bghomstats,bgmerge,bgpredict,blame,stuttermark,stuttermodel
119
120
121
122
123
124
125
126
127
128
129
130
131
random subsampling options  bgestimate,bghomstats,stuttermodel
visualisation options       vis

Input/output of tools:      INPUT           OUTPUT
allelefinder    list of sample files        *single output + report
bgcorrect       bg file + single sample (b) single sample (batches supported)
bgestimate      list of sample files        single output + report
bghomraw        list of sample files        single output
bghomstats      list of sample files        single output
bgmerge^        list of bg files            single output
bgpredict^      model + seqfile             single output
blame           bg file + list of samples   single output
libconvert^     single input library        single output
132
samplestats     single sample file (batch)  single sample (batches supported)
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
seqconvert      single sample file (batch)  single sample (batches supported)
stuttermark     single sample file (batch)  single sample (batches supported)
stuttermodel    list of sample files        single output
vis^            single sample (optional)    single output
*TODO: add option to change single output to multi-out (batch_process=True)
^does not use add_args functions (bgmodel/predict use sequence_format_args)

Input/output conventions:
* Write single output to sys.stdout by default, allow changing by -o
* Write report (if applicable) to sys.stderr by default, allow changing by -R
* For multi-in to single-out: list input files as positionals
* For single-in: provide [IN], [OUT] positionals (defaulting IN to sys.stdin)
* Single-in batch support via -i/-o; mutex with positionals!
  (if len(-o) == len(-i), map infile->outfile; if len(-o) == 1,
   map sample->outfile by rewriting tag)
* Multi-in to multi-out: allow multiple values in -o option (currently unused)

Reserved option letters:
-h  Help (used globally)
-v  Version (used globally)
-d  Debug (used globally)
-i  Batch input files
-o  Output files
-R  Report file
-F  Target sequence format
-l  Library
-e  Sample tag extraction pattern
-f  Sample tag format

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
Sequence format conversions:
From    To
raw     tssv    OK - Transparent to non-STR markers (have no regex_middle).
raw     name    OK - Uses raw->tssv as a first step.
tssv    raw     OK - Trivial case.
tssv    name    (Implemented as tssv->raw->name)
name    raw     (Implemented as name->tssv->raw)
name    tssv    OK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Find TODOs and FIXMEs in the code:
grep "TODO\|FIXME" *.py */*.py */*/*.py


Number of lines, excluding empty lines and comments:
grep -v "^\s*\(#.*\)\?$" *.py */*.py */*/*.py | wc -l