Wordに貼り付けたPDFがベクトル形式ではなくなってしまう現象

タイトルの通り。外部のPDFからWordに貼り付けたPDFは、大抵はそのままベクトル形式で配置され、拡大・縮小しても綺麗なまま保たれる。

しかし、たまにこれがうまく行かず、貼り付けたその時点は綺麗に写っているものの、一度ファイルを閉じて再度開くと(!)荒くぼやけたサムネイルになってしまうことがあった。

色々試してみて分かったことは以下の通り。

  • ある特定のPDFファイルをIllustrtorを使って編集すると起こる(AcrobatKeynoteで編集すると大丈夫だった)
  • それぞれを別々に貼り付けても大丈夫だったものが、複数を(Illustrator, PowerPoint, Keynote等で)1枚のPDFにまとめてから貼り付けるとダメ
  • PDFを経由しないでPowerPointオブジェクトを貼り付けるとうまくいく

結局解決できずPowerPointからオブジェクトを直接コピーして貼り付けることにしたのだが、謎すぎる。Wordが勝手にサイズを圧縮していると思ってそれ関連と思われる色々な機能をオフにしてもダメ。

普段はWord (というかOffice全体)なんて使わないのだが、今回は様々な兼ね合いで使わざるを得ず仕方なくdocxを用意した。途中、何度嫌になったことか。。この手のソフトウエアは、便利さを謳いながら、その実制限された機能を詰め込んでいるだけで、自由度が低く結局やりたいことなんかできないというのが個人的な印象だ。タダ飯は無いのである。

2017/5/22追記

おそらく原因が判明したので追記。Keynoteからオブジェクトをコピーする時に、どうやらベクトル形式のオブジェクトであってもラスター形式でクリップボードに保持されるらしい。。

以前はベクトル形式のままできたと思うのだが(ググるクリップボード経由でpdf保存みたいな記事がいくつか出てくる)。。。

PowerPointは大丈夫。謎仕様だ。Keynoteの株は自分の中で大暴落。(2017/7/5追記: どうやらこのKeynote由来の現象は全体の一部らしく、Keynoteを使わなくても起こるらしい。昔のMavericksとかも引っ張り出して近いうちに原因をちゃんと調査したい。)

画像の一部分の比較

画像処理というには簡単すぎる内容かもしれないが、画像の一部分を切り出してすでにあるものと比較、という処理。最近やっていないのにブックマークが邪魔だったので、ここにまとめようと思い立った。

簡潔にまとめると以下の通り。

画像切り出し

  • $ convert -crop 横ピクセル数x縦ピクセル数+横始点ピクセル+縦始点ピクセル 元画像 出力画像名
    • 例: $ convert -crop 960x720+160+0 src.png dest.jpg
    • ピクセル指定のところは代わりに50%のような割合指定も可能

画像比較

  • $ perceptualdiff -threshold 閾値ピクセル数差 画像1 画像2
    • 例: $ perceptualdiff -threshold 100 fig1.png fig2.png

参考文献

programmer-jobs.blogspot.jp

画像比較 with perceptualdiffkazucocoa.wordpress.com

Rust

最近流行っているらしいRustの解説動画。半分くらいまで視聴。

Ownership/Borrowingという概念でポインタ周りの(潜在的)バグをコンパイル時に見つけたりできるようにしたらしい。発想としてはshared reference (SR; 共有参照?不変参照?とでも言うべきか)/mutable reference (MR; 可変参照?とでも)をうまく使い分けることでC++では未定義動作だった解放済みのアドレス参照を防いでるようだ。1つのオブジェクトに対してshared/mutableを同時に両方は使えないようにして、オブジェクトの参照と変更がお互いを気にしないで行われることを防いでいる(と自分は受け取った)。

また、Ownership概念を使うと、スレッドのmutationを明示的に行わなくてもよくなる?(Ownershipは非同期なスレッドであっても同時にはどちらか一方にしか与えられないから)。いちいちOwnershipのやり取りをしないといけないので実行速度が少し気になるが、どうなのだろうか。

そもそもOwnershipがどのようなものか、どのように付与しているのかがまだよく分かっていないので、機会があれば使用を検討して実際に使いながら理解していきたい。

英語学習

英語力を向上させたい。ので、以下の方針で鍛えていこうと考えている。

ちなみにインド人留学生からは「日常会話を鍛えたいなら Friends (ドラマ)を字幕なしで内容が理解できるまでひたすら繰り返し見ろ」 と言われた。

  • VoiceTube
    • 和訳付き動画
    • TEDやCNN 10も包含していて、洋楽もあるらしい
    • 現状での有力候補少し使ってみたが、かなり良い。TEDを英語+日本語字幕で見られたり、speakingやディクテーションのクイズもあってオールインワンという感じ。

jp.voicetube.com

  • Voice of America
    • アメリカ英語を原稿付き+ゆっくり発音で聞ける

learningenglish.voanews.com

  • English Listening Lesson Libary Online
    • 音声や動画でのレッスンが豊富らしい

www.elllo.org

  • Listen and Write - Dictation
    • ディクテーションの練習ができるらしい

www.listen-and-write.com

* Lang-8 * 外国人と文章の相互添削ができるらしい * 相手もユーザーなので正確ではない可能性がある lang-8.com

-> 現在はHiNativeというサービスに移行しているらしい。が、そちらがどうにも微妙そう(機械翻訳精度が上がれば不要になりそう?)なのでおそらく使わないだろう。

hinative.com

  • Sciwrite Stanford
    • 科学論文の書き方
    • 説明そのものについてもyoutubeの字幕生成が使える

www.youtube.com

参考文献

www.stay-minimal.com

‘Mobilome’ Study of Antibiotic Resistance Implicates Transposon Activity

www.pacb.com

PacBioで高品質なプラスミドのアセンブリ -> 抗生物質耐性遺伝子(ARG)のより良い特徴付け -> ARGの細菌間伝播メカニズム解明、という話。対象としている細菌はNIHで単離培養されたEnterobacteriaceae。Susu Heさんがリーダー。

  • 感染が広がった細菌を数年間に渡ってシークエンシングして、プラスミド中のtarget site duplication (TSD; ゲノム中のある特定のコンテキストにtransposable elementが挿入されること)を追跡した。

https://image.slidesharecdn.com/bacterial-transposons-1235039960223797-2/95/bacterial-transposons-26-728.jpg?cb=1235018415

(https://www.slideshare.net/guest06ad101/bacterial-transposonsより引用)

  • ARGに対抗する手段が見つかる、、かもしれない。

  • PacBioのmultiplexed sequencingを使えば非常に安価にどんどん読めるだろう。

ファージやプラスミドは最近流行りつつあるように思うので、自分の論文も通るといいな。。

文献(pdf)管理ソフトウエアについて

これまでMendeleyを使っていたが、色々と不満を抱いていた。

  • ライブラリの扱いが謎
    • 独自のライブラリ用フォルダを(watch-dog folderとは別に)作ってそこにpdfをダウンロードし始める
    • そのせいか文献が被ることがある
    • 他のマシンに移行するときに非常に不便
    • (無料版では)ライブラリのサイズに制限がある
  • 文献を検索しにくい
  • 他のデバイスで作成したアノテーション情報が正しく表示されない
  • 時々異常動作する

そこで、MacBookProを変えてMendeleyライブラリの重複を一掃したことでアノテーションなどが白紙に戻ったことを期に、ReadCubeを使ってみることにした。

こちらも基本的にはフォルダ(リストと呼んでいる)分けとタグ機能(Pro版のみ)による管理のようだが、Proにすると文献をグラフで表現してくれる機能もあるとか?(なかった。。) trialもできるみたいなので、ちょっと試してみてもしよかったら移行したい。

一番大事な点はライブラリの共有方法だが、どうやら無料版ではローカルのPDFをインポートするだけで、Pro版になるとunlimited cloud syncができるらしい。ライブラリ管理がまともであればPro版にしても構わないかもしれない。今後iPadで論文を読むことがあればだが。最近は印刷して紙で読むのもありかなと思いつつある。

使ってる感じ

  • UIが良い
  • recommendationも良い
  • プレプリント系だとreference情報を付けてくれないことが多く、また、そういった場合にmanualで入力するのが少しやりにくい
  • ライブラリの扱いはまだよく分からない
  • タグの用途としては、favoriteの拡張といった感じか。「輪講用」とか、「ASAP」とか?
    • タグの使い方(note中に"#“を先頭にして記述)が分かりにくい
  • 今開いているpdfがどのリストに属しているのかが表示されず、同じリストから複数のpdfを開きたいときなどに不便

ReadCubeのライブラリの扱いについて

  • Preferencesから指定
  • cloudにあるがローカルにないファイルは指定したディレクトリにダウンロードされる
  • cloudからダウンロードした後、ライブラリのディレクトリを変更しても新しいディレクトリにはダウンロードされない
    • -> 単純にディレクトリを見ているだけではなく、ちゃんとファイルを比較している?
  • ブラウザからだと日本語pdfが表示されないのでローカルAppを使うことにはなりそう
  • ボタン1つでReadCubeに追加できるのは良いが、普通にダウンロードしてもそこまで手間はかからなさそうだしディレクトリ区別もできる

タグの使い方案

  • リストは分野ごとに
  • タグにはpdfの性質を付与
    • book, poster, slide, asap
    • 適当に好きな言葉を適宜付けておけば後から探しやすい
  • favoriteは読んだものに付けていくか

Submitting (PacBio data) to SRA

How can I submit my (metagenomic) PacBio raw data (*.bax.h5) to the SRA database?

Read the quick guide

Data requirement (PacBio RS II)

Submission of data from the RS II instrument requires one (1) bas.h5 file and three (3) bax.h5 files. Do not link more than one PacBio RS II to an SRA run and please do not change the bax.h5 files names from those indicated in the bas.h5 file.

Submitting steps

  1. Login to or sign up for an NCBI account
  2. Register your project and biological samples:
  3. Create your SRA data submission and upload sequence data files:

    • Submit SRA metadata - information that will link your project, samples/experiments and file names
    • Upload sequence data files in SRA submission portal
  4. If you have already prepared all data for uploading, you can register BioProject and BioSample while creating SRA; that is, you do not have to use BioProject/BioSample submission portal.

  5. You must register BioProject and BioSample before creating SRA if you want to get only the Accession number (without uploading sequence data).

What are accession numbers?

  • SRA (SUBMISSION)
    • SRP# (STUDY) — PRJNA# in BioProject
      • SRS# (SAMPLE) — SAMN# in BioSample
        • SRX# (EXPERIMENT)
          • SRR# (RUN)

We recommend using SRP# in publications.

All submissions have a SUB#. The SUB# is non-public identifier that is used by software for tracking purposes.

On the human metagenomic sample

Human metagenomic studies may contain human sequences and require that the donor provide consent to archive their data in an unprotected database. If you would like to archive human metagenomic sequences in the public SRA database please contact the SRA and we will screen and remove human sequence contaminants from your submission.

  • I removed putative human genomic sequences by myself, but they can do it instead?

See also:

Register BioProject and BioSample (original doc)

Registering project and biological samples at the NCBI BioProject and the BioSample databases is a prerequisite for any public SRA submission. The BioProject and BioSample databases store data that relate to organizational and biological aspects of sequencing experiments.

BioProject

BioProject submission portal -> “New submission” -> Follow the wizard –…

You don’t have to provide BioSample accession(s) or register your sample(s) within the BioProject submission wizard.

…–> “Submit”

To update an existing record or recent submission, please email (bioprojecthelp@ncbi.nlm.nih.gov) your request with your BioProject ID or Submission ID included. Do not create new submission to update an existing submission!

BioSample

BioSample is a record of biological isolate with unique physical properties. Biological and technical replicates (in most cases) should not be considered unique BioSamples.

BioSample submission portal -> “New submission” -> Follow the wizard –…

In Attributes section: download Excel template, fill it out, convert into tab-delimited text file, and upload the text file.

To update BioSample’s attributes, contact BioSample staff at biosamplehelp@ncbi.nlm.nih.gov.

…–> “Submit”

Create SRA (original doc)

The SRA metadata describes the technical aspects of sequencing experiments: the sequencing libraries, preparation techniques and data files.

Each EXPERIMENT has a unique combination of replicate number + library + sequencing strategy + layout + instrument model

RUN is simply a manifest of data file(s) that are derived from sequencing a library described by the associated EXPERIMENT

SRA submission portal -> “Command line upload options” -> “Request preload folder” (-> Choose either “Aspera command line upload” or “FTP upload” for the future uploading of files, and read it) -> Upload all files via Aspera/FTP –…

Each file must be listed in the SRA metadata table you uploaded. If you are uploading a tar archive, list each file name, not the archive name.

  • I uploaded .tar archives of .bax.h5 files for each EXPERIMENT, and used lftp command for FTP.

…–> “New submission” -> Follow the wizard

Upload data with Aspera

Submission Portal provides options for transferring your sequence files using FTP or Aspera command line (recommended for all submissions) and via browser-based HTTP/Aspera transfer protocol (recommended only for small submissions and small files).