-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.xml
More file actions
263 lines (204 loc) · 15.8 KB
/
index.xml
File metadata and controls
263 lines (204 loc) · 15.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>logspace</title>
<link>http://logspace.co.uk/index.xml</link>
<description>Recent content on logspace</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<copyright> </copyright>
<lastBuildDate>Thu, 12 Jan 2017 09:49:10 +0000</lastBuildDate>
<atom:link href="http://logspace.co.uk/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Dealing with macOS aliases on the command-line</title>
<link>http://logspace.co.uk/post/alias-resolver/</link>
<pubDate>Thu, 12 Jan 2017 09:49:10 +0000</pubDate>
<guid>http://logspace.co.uk/post/alias-resolver/</guid>
<description><p>If you&rsquo;ve been using a Mac for a while, you&rsquo;ve probably come up against
<a href="https://en.wikipedia.org/wiki/Alias_(Mac_OS)">Aliases</a>. They&rsquo;re similar in
many ways to the Unix <a href="https://en.wikipedia.org/wiki/Symbolic_link">Symbolic
Link</a>, but have their own set of
advantages and disadvantages. The main advantage is you can move the original
file to a new location on the same disk, and the alias will still find it. The
main disadvantage (for me) is that the OS X Unix layer doesn&rsquo;t know what to do
with them.</p>
<p>We use aliases in <a href="http://papersapp.com">Papers</a> for various reasons, and I
needed a way to handle them from the node.js world. For that reason, I wrote a
small module called <a href="https://www.npmjs.com/package/alias-resolver">Alias
Resolver</a>. I recently updated the
module to support the creation of aliases (mainly because it is useful for
testing). As a side-effect of this, the module is now usable for creating and
resolving aliases on the command-line.</p>
<p>To create an alias in the shell, you may have used some <a href="http://stackoverflow.com/questions/7072208/how-do-i-create-a-macintosh-finder-alias-from-the-command-line">funky-looking
AppleScript</a>
to tell the Finder to do it for you. Now, it&rsquo;s much simpler (assuming you have
<a href="http://brew.sh">Homebrew</a> or Node.js), as Alias Resolver comes with the
<code>create-alias</code> and <code>resolve-alias</code> commands.</p>
<pre><code> $ brew install node
$ npm install -g alias-resolver
$ create-alias /bin/ls /tmp/ls-alias
$ file /tmp/ls-alias
/tmp/ls-alias: MacOS Alias file
$ cat /tmp/ls-alias
bookmark88&lt;'Atbinv8A file:///
Macintosh H(A&amp;$FE16297F-ACA3-31D2-88EF-3B67691353C9/0dnib(Xx@h ( 0 4&quot;&lt;%
$ resolve-alias /tmp/ls-alias
/bin/ls
</code></pre>
</description>
</item>
<item>
<title>Ben Blackburne</title>
<link>http://logspace.co.uk/page/about/</link>
<pubDate>Mon, 10 Oct 2016 20:38:59 +0100</pubDate>
<guid>http://logspace.co.uk/page/about/</guid>
<description>
<p>I work for <del><a href="https://papersapp.com/">Papers</a></del>
<a href="https://readcube.com">ReadCube</a> doing Cocoa development and data science with
a side of node.js. In a previous existence I was a bioinformatician.</p>
<h2 id="selected-publications">Selected Publications</h2>
<p><a href="http://mbe.oxfordjournals.org/content/early/2012/12/04/molbev.mss256.full.pdf">Class of multiple sequence alignment algorithm affects genomic analysis</a>
<em>Molecular Biology and Evolution</em> <a href="http://doi.org/10.1093/molbev/mss256">http://doi.org/10.1093/molbev/mss256</a></p>
<p><a href="http://bioinformatics.oxfordjournals.org/content/28/4/495.full.pdf">Measuring the distance between multiple sequence alignments</a>
<em>Bioinformatics</em> <a href="http://doi.org/10.1093/bioinformatics/btr701">http://doi.org/10.1093/bioinformatics/btr701</a>.</p>
<p><a href="http://rdcu.be/g1Wf">Mutation spectrum revealed by breakpoint sequencing of human germline CNVs</a><br />
<em>Nature Genetics</em> <a href="http://doi.org/10.1038/ng.564">http://doi.org/10.1038/ng.564</a>.</p>
<p><a href="http://journals.plos.org/plospathogens/article/asset?id=10.1371/journal.ppat.1000058.PDF">Changing Selective Pressure during Antigenic Changes in Human Influenza H3</a><br />
<em>PLoS Pathogens</em> <a href="http://doi.org/10.1371/journal.ppat.1000058">http://doi.org/10.1371/journal.ppat.1000058</a>.</p>
<p><a href="http://logspace.co.uk/papers/3D-Functional-Model-Proteins.pdf">Three Dimensional Functional Model Proteins: Structure, Function and Evolution</a><br />
<em>Journal of Chemical Physics</em> <a href="http://doi.org/10.1063/1.1590310">http://doi.org/10.1063/1.1590310</a>.</p>
<p>A <a href="http://logspace.co.uk/page/publications/">fuller publication list is available</a>.</p>
<h2 id="contact">Contact</h2>
<p>Twitter: <a href="http://twitter.com/bpb">bpb</a><br />
Email: bpb@<span style="display:none;">null</span>lysozyme.net</p>
</description>
</item>
<item>
<title>Publications</title>
<link>http://logspace.co.uk/page/publications/</link>
<pubDate>Mon, 10 Oct 2016 20:38:59 +0100</pubDate>
<guid>http://logspace.co.uk/page/publications/</guid>
<description>
<p><a href="http://gbe.oxfordjournals.org/content/7/8/2102.full.pdf">Evidence of Statistical Inconsistency of Phylogenetic Methods in the Presence of Multiple Sequence Alignment Uncertainty</a>
<em>Genome Biology and Evolution</em> <a href="http://doi.org/10.1093/gbe/evv127">http://doi.org/10.1093/gbe/evv127</a>.</p>
<p><a href="http://sysbio.oxfordjournals.org/content/early/2014/10/07/sysbio.syu062.full.pdf">ModelOMatic: Fast and Automated Model Selection between RY, Nucleotide, Amino Acid, and Codon Substitution Models</a>
<em>Systematic Biology</em> <a href="http://doi.org/10.1093/sysbio/syu062">http://doi.org/10.1093/sysbio/syu062</a></p>
<p><a href="http://mbe.oxfordjournals.org/content/early/2012/12/04/molbev.mss256.full.pdf">Class of multiple sequence alignment algorithm affects genomic analysis</a>
<em>Molecular Biology and Evolution</em> <a href="http://doi.org/10.1093/molbev/mss256">http://doi.org/10.1093/molbev/mss256</a></p>
<p><a href="http://bioinformatics.oxfordjournals.org/content/28/4/495.full.pdf">Measuring the distance between multiple sequence alignments</a>
<em>Bioinformatics</em> <a href="http://doi.org/10.1093/bioinformatics/btr701">http://doi.org/10.1093/bioinformatics/btr701</a>.</p>
<p><a href="http://mbe.oxfordjournals.org/content/28/1/449.full.pdf">Phylogenetic substitution models for detecting heterotachy during plastid evolution</a><br />
<em>Molecular Biology and Evolution</em> <a href="http://doi.org/10.1093/molbev/nmsq215">http://doi.org/10.1093/molbev/msq215</a>.</p>
<p><a href="http://rdcu.be/g1Wf">Mutation spectrum revealed by breakpoint sequencing of human germline CNVs</a><br />
<em>Nature Genetics</em> <a href="http://doi.org/10.1038/ng.564">http://doi.org/10.1038/ng.564</a>.</p>
<p><a href="http://journals.plos.org/plospathogens/article/asset?id=10.1371/journal.ppat.1000058.PDF">Changing Selective Pressure during Antigenic Changes in Human Influenza H3</a><br />
<em>PLoS Pathogens</em> <a href="http://doi.org/10.1371/journal.ppat.1000058">http://doi.org/10.1371/journal.ppat.1000058</a>.</p>
<p><a href="http://journals.plos.org/ploscompbiol/article/asset?id=10.1371/journal.pcbi.0020069.PDF">Assessing the Accuracy of Ancestral Protein Reconstruction Methods</a><br />
<em>PLoS Computational Biology</em> <a href="http://doi.org/10.1371/journal.pcbi.0020069">http://doi.org/10.1371/journal.pcbi.0020069</a>.</p>
<p><a href="papers/FMP-Population-Dynamics.pdf">Population Dynamics Simulations of Functional Model Proteins</a><br />
<em>Journal of Chemical Physics</em> <a href="http://doi.org/10.1063/1.2056545">http://doi.org/10.1063/1.2056545</a>.</p>
<p><a href="http://logspace.co.uk/papers/3D-Functional-Model-Proteins.pdf">Three Dimensional Functional Model Proteins: Structure, Function and Evolution</a><br />
<em>Journal of Chemical Physics</em> <a href="http://doi.org/10.1063/1.1590310">http://doi.org/10.1063/1.1590310</a>.</p>
<p><a href="papers/ppsn2002.pdf">Multimeme Algorithms for Protein Structure Prediction</a><br />
<em>Lecture Notes in Computer Science</em> <a href="http://doi.org/10.1007/3-540-45712-7_74">http://doi.org/10.1007/3-540-45712-7_74</a>.</p>
<p><a href="http://logspace.co.uk/papers/Evolution-of-Functional-Model-Proteins.pdf">Evolution of Functional Model Proteins</a><br />
<em>Journal of Chemical Physics</em> <a href="http://doi.org/10.1063/1.1383051">http://doi.org/10.1063/1.1383051</a>.</p>
<h3 id="book-chapter">Book Chapter</h3>
<ul>
<li>Matt Wood and Ben Blackburne. <strong>Life in Data: The Story of DNA</strong>. In <em>Beautiful Data</em>, Toby Segaran and Jeff Hammerbacher (eds.)</li>
</ul>
</description>
</item>
<item>
<title>Creating an NPM module in TypeScript</title>
<link>http://logspace.co.uk/post/typescript-module/</link>
<pubDate>Mon, 10 Oct 2016 20:22:00 +0100</pubDate>
<guid>http://logspace.co.uk/post/typescript-module/</guid>
<description>
<p>I&rsquo;m a great believer in type systems and we&rsquo;ve recently started to use
TypeScript. We want to mix TypeScript modules into our existing node.js code.
However, TypeScript is a rapidly changing ecosystem, which meant I went down
some blind alleys when trying to figure out how to set up an npm module.
It turns out, with TypeScript 2.0, it&rsquo;s really simple. Here&rsquo;s one suggestion
for how to get started. Begin with a directory for your project and</p>
<pre><code>npm init
</code></pre>
<p>Set your entry point to <code>dist/${projectName}.js</code>. For instance, for a project called safeLeftPad, put this in package.json:</p>
<pre><code>{
…
&quot;main&quot;: &quot;dist/safeLeftPad.js&quot;,
…
}
</code></pre>
<p>You&rsquo;re going to need to install TypeScript if you haven&rsquo;t already. Let&rsquo;s
install it globally, and in the project so random JavaScript hackers can still
compile our module.</p>
<pre><code>npm install --save-dev typescript
npm install --global typescript
</code></pre>
<p>Typescript uses a <code>tsconfig.json</code> file to configure the compiler. Let&rsquo;s autogenerate one:</p>
<pre><code>tsc --init
</code></pre>
<p>You need to edit it to output to the correct directory (<code>dist</code>) and set the
source location. You only need to point it at the main entry point file. I also
turn on <code>noImplicitAny</code> to keep me honest, and target es6 to get the cool
stuff. My <code>tsconfig.json</code> now looks like this:</p>
<pre><code>{
&quot;compilerOptions&quot;: {
&quot;module&quot;: &quot;commonjs&quot;,
&quot;target&quot;: &quot;es6&quot;,
&quot;noImplicitAny&quot;: true,
&quot;sourceMap&quot;: false,
&quot;outDir&quot;: &quot;dist&quot;
},
&quot;files&quot;: [
&quot;src/safeLeftPad.ts&quot;
]
}
</code></pre>
<p>Add <code>tsc</code> as a prepublish command to <code>package.json</code> so the TypeScript is compiled when you
package. My <code>package.json</code> now looks like this:</p>
<pre><code>{
&quot;name&quot;: &quot;safe-left-pad&quot;,
&quot;version&quot;: &quot;0.0.1&quot;,
&quot;description&quot;: &quot;&quot;,
&quot;main&quot;: &quot;dist/safeLeftPad.js&quot;,
&quot;scripts&quot;: {
&quot;prepublish&quot;: &quot;tsc&quot;,
&quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;
},
&quot;author&quot;: &quot;Ben Blackburne&quot;,
&quot;license&quot;: &quot;ISC&quot;,
&quot;devDependencies&quot;: {
&quot;typescript&quot;: &quot;^2.0.3&quot;
}
}
</code></pre>
<p>To compile your TypeScript, simply run <code>tsc</code> and the appropriate <code>.js</code> and
<code>.d.ts</code> files are created in <code>dist/</code>. You don&rsquo;t need <code>autodts</code>.</p>
<h2 id="a-word-about-typings">A word about typings</h2>
<p>The first thing you are probably going to do is try and use some node modules.
To do so, you need the appropriate Declaration Files for the module, which
contain the type definitions. There&rsquo;s a bunch of pre-existing projects for this
(e.g. <code>typings</code>, DefinitelyTyped). However, it is now all integrated into <code>npm</code>
and you need (in theory) do nothing more than <code>npm install @types/${moduleName}</code>.
I&rsquo;ve come across a couple of gotchas though.</p>
<p>Firstly, the type definitions won&rsquo;t necessarily match the module version, and
<code>npm</code> won&rsquo;t care. For instance:</p>
<pre><code>npm install request-promise @types/request-promise --save
</code></pre>
<p>At time of writing, this will happily install request-types version 4, and the
definitions for version 3. In this case, I suggest you manually use the older version of <code>request-promise</code>:</p>
<pre><code>npm install request-promise@3.0.0 @types/request-promise@3.0.0 --save
</code></pre>
<p>Secondly, it doesn&rsquo;t seem to handle dependencies well. On compiling a project,
you may find an error about missing dependencies:</p>
<pre><code>node_modules/@types/request-promise/index.d.ts(10,30): error TS2307: Cannot find module 'bluebird'.
</code></pre>
<p>So you have to manually install the missing definitions:</p>
<pre><code>npm install @types/bluebird --save
</code></pre>
</description>
</item>
</channel>
</rss>