LoginSignup
3
0

More than 5 years have passed since last update.

Galaxyでカンマ区切りをタブ区切りに変換してみよう

Last updated at Posted at 2017-12-08

データ処理を始める前に、タブで区切られていないデータファイルをタブ区切りに変換しよう。

変換元のデータは次の通り
Screen Shot 2017-12-07 at 11.02.54.png

画面の右の"History"にあるデータの区切りをタブに変換するには、"Tools"の"Text Manipulation"をクリック
TextManipulation.png

展開された中から"Convert Delimiters to TAB"をクリック
TextManipulation_ConvertDelimitersToTab.png

"Convert All"のフィールドで元の区切り文字を選ぶ
TextManipulation_ConvertDelimitersToTab_ConvertAll.png

ここではカンマを選択
TextManipulation_ConvertDelimitersToTab_ConvertAll_SelectComma.png

カンマ以外に次のような文字を区切りとして選べる

区切り文字 指定する方法
(空白) Whitespaces
(タブ) Tabs
. Dots
, Commas
- Dashes
Pipes
: Colons
; Semicolons

変換したいファイルを"In Dataset"で指定する
TextManipulation_ConvertDelimitersToTab_SelectFile.png

"Condense consecutive delimiters in one TAB"(連続する区切り文字をひとまとめのTABにする)をNo に変更する
TextManipulation_ConvertDelimitersToTab_No_Consecutive.png
"Condense consecutive delimiters in one TAB"をYesだと、データが何も無い場合にカラムの位置がずれてしまう

"Execute"で実行
TextManipulation_ConvertDelimitersToTab_Execute.png

結果を確認するために、画面右側の"History"の目玉のアイコンをクリック
TextManipulation_ConvertDelimitersToTab_ViewData.png

TAB区切りとなって、データがテーブルとして認識されると少し見やすく表示される
TextManipulation_ConvertDelimitersToTab_Result.png
特定のカラムを取り出したり、集計したりという処理を行うにはTAB区切りでデーターを格納している事がとても重要

今日はここまで:smiley:

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0