Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Commit

Permalink
Add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Aug 22, 2016
1 parent b449cb2 commit 650b63b
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/__tests__/bibtex-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ describe('bibtex', () => {
expect(result).to.have.length(2);
expect(result.map((e) => e.html).join('\n\n')).to.equal(expected);
});

it('should sort the entries', () => {
const [content, expected] = fixture('multi-unsorted');
const result = bibtex.parse(content);

expect(result).to.have.length(2);
expect(result.map((e) => e.html).join('\n\n')).to.equal(expected);
});
});

describe('html.renderReferences()', () => {
Expand Down
44 changes: 44 additions & 0 deletions app/__tests__/fixtures/bib/multi-unsorted.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@article{li_fast_2010,
title = {Fast and accurate long-read alignment with {Burrows}–{Wheeler} transform},
volume = {26},
issn = {1367-4803, 1460-2059},
url = {http://bioinformatics.oxfordjournals.org/content/26/5/589},
doi = {10.1093/bioinformatics/btp698},
abstract = {Motivation: Many programs for aligning short sequencing reads to a reference genome have been developed in the last 2 years. Most of them are very efficient for short reads but inefficient or not applicable for reads {\textgreater}200 bp because the algorithms are heavily and specifically tuned for short queries with low sequencing error rate. However, some sequencing platforms already produce longer reads and others are expected to become available soon. For longer reads, hashing-based software such as BLAT and SSAHA2 remain the only choices. Nonetheless, these methods are substantially slower than short-read aligners in terms of aligned bases per unit time.
Results: We designed and implemented a new algorithm, Burrows-Wheeler Aligner's Smith-Waterman Alignment (BWA-SW), to align long sequences up to 1 Mb against a large sequence database (e.g. the human genome) with a few gigabytes of memory. The algorithm is as accurate as SSAHA2, more accurate than BLAT, and is several to tens of times faster than both.
Availability: http://bio-bwa.sourceforge.net
Contact: rd@sanger.ac.uk},
language = {en},
number = {5},
urldate = {2016-05-12},
journal = {Bioinformatics},
author = {Li, Heng and Durbin, Richard},
month = mar,
year = {2010},
pmid = {20080505},
pages = {589--595}
}

@article{li_fast_2009,
title = {Fast and accurate short read alignment with {Burrows}-{Wheeler} transform},
volume = {25},
issn = {1367-4811},
doi = {10.1093/bioinformatics/btp324},
abstract = {MOTIVATION: The enormous amount of short reads generated by the new DNA sequencing technologies call for the development of fast and accurate read alignment programs. A first generation of hash table-based methods has been developed, including MAQ, which is accurate, feature rich and fast enough to align short reads from a single individual. However, MAQ does not support gapped alignment for single-end reads, which makes it unsuitable for alignment of longer reads where indels may occur frequently. The speed of MAQ is also a concern when the alignment is scaled up to the resequencing of hundreds of individuals.
RESULTS: We implemented Burrows-Wheeler Alignment tool (BWA), a new read alignment package that is based on backward search with Burrows-Wheeler Transform (BWT), to efficiently align short sequencing reads against a large reference sequence such as the human genome, allowing mismatches and gaps. BWA supports both base space reads, e.g. from Illumina sequencing machines, and color space reads from AB SOLiD machines. Evaluations on both simulated and real data suggest that BWA is approximately 10-20x faster than MAQ, while achieving similar accuracy. In addition, BWA outputs alignment in the new standard SAM (Sequence Alignment/Map) format. Variant calling and other downstream analyses after the alignment can be achieved with the open source SAMtools software package.
AVAILABILITY: http://maq.sourceforge.net.},
language = {eng},
number = {14},
journal = {Bioinformatics (Oxford, England)},
author = {Li, Heng and Durbin, Richard},
month = jul,
year = {2009},
pmid = {19451168},
pmcid = {PMC2705234},
keywords = {Algorithms, Genomics, Sequence Alignment, Sequence Analysis, DNA, software},
pages = {1754--1760}
}
--- EXPECTED ---
Li, H. & Durbin, R. (2009). Fast and accurate short read alignment with Burrows-Wheeler transform. <em>Bioinformatics (Oxford, England)</em>, 25(14), 1754—1760. <a href="http://dx.doi.org/10.1093/bioinformatics/btp324" rel="noreferrer noopener">http://dx.doi.org/10.1093/bioinformatics/btp324</a>
Li, H. & Durbin, R. (2010). Fast and accurate long-read alignment with Burrows–Wheeler transform. <em>Bioinformatics</em>, 26(5), 589—595. <a href="http://dx.doi.org/10.1093/bioinformatics/btp698" rel="noreferrer noopener">http://dx.doi.org/10.1093/bioinformatics/btp698</a>
39 changes: 39 additions & 0 deletions app/markdown-it-plugins/__tests__/fixtures/cite.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,42 @@ should parse block with `cite` even if there are extra spaces
.
<p class="citation">Hebert, M. & Lewicki, M. (2007). Artificial Intelligence, Logic and Reasoning. Lecture. Available from https://www.cs.cmu.edu/afs/cs/academic/class/15381-s07/www/slides/022707reasoning.pdf</p>
.

should parse and render other fence blocks
.
``` php
<?php

echo 'Hello';
```
.
<pre><code class="language-php">&lt;?php

echo 'Hello';
</code></pre>
.

should deal with multiple `cite` blocks
.
As in [@logicreasoning;@another] ...

```cite
@misc{logicreasoning,
title={Artificial Intelligence, Logic and Reasoning},
author={Martial Hebert and Mike Lewicki},
year={2007}
}
```

``` cite
@misc{another,
title={Another Brick In The Wall},
author={Pink Floyd},
year={1979}
}
```
.
<p>As in (Hebert & Lewicki, 2007; Floyd, 1979) ...</p>
<p class="citation">Hebert, M. & Lewicki, M. (2007). Artificial Intelligence, Logic and Reasoning. </p>
<p class="citation"> & Floyd, P. (1979). Another Brick In The Wall. </p>
.

0 comments on commit 650b63b

Please sign in to comment.