0
|
1 <html>
|
|
2 <head>
|
|
3 <title>MayaChemTools:Documentation:MergeTextFilesWithSD.pl</title>
|
|
4 <meta http-equiv="content-type" content="text/html;charset=utf-8">
|
|
5 <link rel="stylesheet" type="text/css" href="../../css/MayaChemTools.css">
|
|
6 </head>
|
|
7 <body leftmargin="20" rightmargin="20" topmargin="10" bottommargin="10">
|
|
8 <br/>
|
|
9 <center>
|
|
10 <a href="http://www.mayachemtools.org" title="MayaChemTools Home"><img src="../../images/MayaChemToolsLogo.gif" border="0" alt="MayaChemTools"></a>
|
|
11 </center>
|
|
12 <br/>
|
|
13 <div class="DocNav">
|
|
14 <table width="100%" border=0 cellpadding=0 cellspacing=2>
|
|
15 <tr align="left" valign="top"><td width="33%" align="left"><a href="./MergeTextFiles.html" title="MergeTextFiles.html">Previous</a> <a href="./index.html" title="Table of Contents">TOC</a> <a href="./ModifyNewLineChar.html" title="ModifyNewLineChar.html">Next</a></td><td width="34%" align="middle"><strong>MergeTextFilesWithSD.pl</strong></td><td width="33%" align="right"><a href="././code/MergeTextFilesWithSD.html" title="View source code">Code</a> | <a href="./../pdf/MergeTextFilesWithSD.pdf" title="PDF US Letter Size">PDF</a> | <a href="./../pdfgreen/MergeTextFilesWithSD.pdf" title="PDF US Letter Size with narrow margins: www.changethemargins.com">PDFGreen</a> | <a href="./../pdfa4/MergeTextFilesWithSD.pdf" title="PDF A4 Size">PDFA4</a> | <a href="./../pdfa4green/MergeTextFilesWithSD.pdf" title="PDF A4 Size with narrow margins: www.changethemargins.com">PDFA4Green</a></td></tr>
|
|
16 </table>
|
|
17 </div>
|
|
18 <p>
|
|
19 </p>
|
|
20 <h2>NAME</h2>
|
|
21 <p>MergeTextFilesWithSD.pl - Merge CSV or TSV TextFile(s) into SDFile</p>
|
|
22 <p>
|
|
23 </p>
|
|
24 <h2>SYNOPSIS</h2>
|
|
25 <p>MergeTextFilesWithSD.pl SDFile TextFile(s)...</p>
|
|
26 <p>MergeTextFilesWithSD.pl [<strong>-h, --help</strong>] [<strong>--indelim</strong> comma | semicolon]
|
|
27 [<strong>-c, --columns</strong> colnum,...;... | collabel,...;...] [<strong>-k, --keys</strong> colkeynum;... | colkeylabel;...]
|
|
28 [<strong>-m, --mode</strong> colnum | collabel] [<strong>-o, --overwrite</strong>] [<strong>-r, --root</strong> rootname]
|
|
29 [<strong>-s, --sdkey</strong> sdfieldname] [<strong>-w, --workingdir</strong> dirname] SDFile TextFile(s)...</p>
|
|
30 <p>
|
|
31 </p>
|
|
32 <h2>DESCRIPTION</h2>
|
|
33 <p>Merge multiple CSV or TSV <em>TextFile(s)</em> into <em>SDFile</em>. Unless <strong>-k --keys</strong>
|
|
34 option is used, data rows from all <em>TextFile(s)</em> are added to <em>SDFile</em> in a
|
|
35 sequential order, and the number of compounds in <em>SDFile</em> is used to determine
|
|
36 how many rows of data are added from <em>TextFile(s)</em>.</p>
|
|
37 <p>Multiple <em>TextFile(s)</em> names are separated by spaces. The valid file extensions are <em>.csv</em> and
|
|
38 <em>.tsv</em> for comma/semicolon and tab delimited text files respectively. All other file names
|
|
39 are ignored. All the text files in a current directory can be specified by <em>*.csv</em>,
|
|
40 <em>*.tsv</em>, or the current directory name. The <strong>--indelim</strong> option determines the
|
|
41 format of <em>TextFile(s)</em>. Any file which doesn't correspond to the format indicated
|
|
42 by <strong>--indelim</strong> option is ignored.</p>
|
|
43 <p>
|
|
44 </p>
|
|
45 <h2>OPTIONS</h2>
|
|
46 <dl>
|
|
47 <dt><strong><strong>-h, --help</strong></strong></dt>
|
|
48 <dd>
|
|
49 <p>Print this help message.</p>
|
|
50 </dd>
|
|
51 <dt><strong><strong>--indelim</strong> <em>comma | semicolon</em></strong></dt>
|
|
52 <dd>
|
|
53 <p>Input delimiter for CSV <em>TextFile(s)</em>. Possible values: <em>comma or semicolon</em>.
|
|
54 Default value: <em>comma</em>. For TSV files, this option is ignored and <em>tab</em> is used as a
|
|
55 delimiter.</p>
|
|
56 </dd>
|
|
57 <dt><strong><strong>-c, --columns</strong> <em>colnum,...;... | collabel,...;...</em></strong></dt>
|
|
58 <dd>
|
|
59 <p>This value is mode specific. It is a list of columns to merge into <em>SDFile</em>
|
|
60 specified by column numbers or labels for each text file delimited by ";".
|
|
61 All <em>TextFile(s)</em> are merged into <em>SDFile</em>.</p>
|
|
62 <p>Default value: <em>all;all;...</em>. By default, all columns from TextFile(s) are
|
|
63 merged into <em>SDFile</em>.</p>
|
|
64 <p>For <em>colnum</em> mode, input value format is: <em>colnum,...;colnum,...;...</em>. Example:</p>
|
|
65 <div class="OptionsBox">
|
|
66 "1,2;1,3,4;7,8,9"</div>
|
|
67 <p>For <em>collabel</em> mode, input value format is: <em>collabel,...;collabel,...;...</em>. Example:</p>
|
|
68 <div class="OptionsBox">
|
|
69 "MW,SumNO;SumNHOH,ClogP,PSA;MolName,Mol_Id,Extreg"</div>
|
|
70 </dd>
|
|
71 <dt><strong><strong>-k, --keys</strong> <em>colkeynum;... | colkeylabel;...</em></strong></dt>
|
|
72 <dd>
|
|
73 <p>This value is mode specific. It specifies column keys to use for merging
|
|
74 <em>TextFile(s)</em> into <em>SDFile</em>. The column keys, delimited by ";", are specified by column
|
|
75 numbers or labels for <em>TextFile(s)</em>.</p>
|
|
76 <p>By default, data rows from <em>TextFile(s)</em> are merged into <em>SDFile</em> in the order they appear.</p>
|
|
77 <p>For <em>colnum</em> mode, input value format is:<em>colkeynum, colkeynum;...</em>. Example:</p>
|
|
78 <div class="OptionsBox">
|
|
79 "1;3;7"</div>
|
|
80 <p>For <em>collabel</em> mode, input value format is:<em>colkeylabel, colkeylabel;...</em>. Example:</p>
|
|
81 <div class="OptionsBox">
|
|
82 "Mol_Id;Mol_Id;Cmpd_Id"</div>
|
|
83 </dd>
|
|
84 <dt><strong><strong>-m, --mode</strong> <em>colnum | collabel</em></strong></dt>
|
|
85 <dd>
|
|
86 <p>Specify how to merge <em>TextFile(s)</em> into <em>SDFile</em>: using column numbers or column labels.
|
|
87 Possible values: <em>colnum or collabel</em>. Default value: <em>colnum</em>.</p>
|
|
88 </dd>
|
|
89 <dt><strong><strong>-o, --overwrite</strong></strong></dt>
|
|
90 <dd>
|
|
91 <p>Overwrite existing files.</p>
|
|
92 </dd>
|
|
93 <dt><strong><strong>-r, --root</strong> <em>rootname</em></strong></dt>
|
|
94 <dd>
|
|
95 <p>New SD file name is generated using the root: <Root>.sdf. Default file name:
|
|
96 <InitialSDFileName>MergedWith<FirstTextFileName>1To<Count>.sdf.</p>
|
|
97 </dd>
|
|
98 <dt><strong><strong>-s, --sdkey</strong> <em>sdfieldname</em></strong></dt>
|
|
99 <dd>
|
|
100 <p><em>SDFile</em> data field name used as a key to merge data from TextFile(s). By default,
|
|
101 data rows from <em>TextFile(s)</em> are merged into <em>SDFile</em> in the order they appear.</p>
|
|
102 </dd>
|
|
103 <dt><strong><strong>-w, --workingdir</strong> <em>dirname</em></strong></dt>
|
|
104 <dd>
|
|
105 <p>Location of working directory. Default: current directory.</p>
|
|
106 </dd>
|
|
107 </dl>
|
|
108 <p>
|
|
109 </p>
|
|
110 <h2>EXAMPLES</h2>
|
|
111 <p>To merge Sample1.csv and Sample2.csv into Sample.sdf and generate
|
|
112 NewSample.sdf, type:</p>
|
|
113 <div class="ExampleBox">
|
|
114 % MergeTextFileswithSD.pl -r NewSample -o Sample.sdf
|
|
115 Sample1.csv Sample2.csv</div>
|
|
116 <p>To merge all Sample*.tsv into Sample.sdf and generate NewSample.sdf file, type:</p>
|
|
117 <div class="ExampleBox">
|
|
118 % MergeTextFilesWithSD.pl -r NewSample -o Sample.sdf
|
|
119 Sample*.tsv</div>
|
|
120 <p>To merge column numbers "1,2" and "3,4,5" from Sample2.csv and Sample3.csv
|
|
121 into Sample.sdf and to generate NewSample.sdf, type:</p>
|
|
122 <div class="ExampleBox">
|
|
123 % MergeTextFilesWithSD.pl -r NewSample -m colnum -c "1,2;3,4,5"
|
|
124 -o Sample.sdf Sample1.csv Sample2.csv</div>
|
|
125 <p>To merge column "Mol_ID,Formula,MolWeight" and "Mol_ID,ChemBankID,NAME"
|
|
126 from Sample1.csv and Sample2.csv into Sample.sdf using "Mol_ID" as SD and column keys
|
|
127 to generate NewSample.sdf, type:</p>
|
|
128 <div class="ExampleBox">
|
|
129 % MergeTextFilesWithSD.pl -r NewSample -s Mol_ID -k "Mol_ID;Mol_ID"
|
|
130 -m collabel -c "Mol_ID,Formula,MolWeight;Mol_ID,ChemBankID,NAME"
|
|
131 -o Sample1.sdf Sample1.csv Sample2.csv</div>
|
|
132 <p>
|
|
133 </p>
|
|
134 <h2>AUTHOR</h2>
|
|
135 <p><a href="mailto:msud@san.rr.com">Manish Sud</a></p>
|
|
136 <p>
|
|
137 </p>
|
|
138 <h2>SEE ALSO</h2>
|
|
139 <p><a href="./ExtractFromSDFiles.html">ExtractFromSDFiles.pl</a>, <a href="./FilterSDFiles.html">FilterSDFiles.pl</a>, <a href="./InfoSDFiles.html">InfoSDFiles.pl</a>, <a href="./JoinSDFiles.html">JoinSDFiles.pl</a>, <a href="./JoinTextFiles.html">JoinTextFiles.pl</a>, 
|
|
140 <a href="./MergeTextFiles.html">MergeTextFiles.pl</a>, <a href="./ModifyTextFilesFormat.html">ModifyTextFilesFormat.pl</a>, <a href="./SplitSDFiles.html">SplitSDFiles.pl</a>, <a href="./SplitTextFiles.html">SplitTextFiles.pl</a>
|
|
141 </p>
|
|
142 <p>
|
|
143 </p>
|
|
144 <h2>COPYRIGHT</h2>
|
|
145 <p>Copyright (C) 2015 Manish Sud. All rights reserved.</p>
|
|
146 <p>This file is part of MayaChemTools.</p>
|
|
147 <p>MayaChemTools is free software; you can redistribute it and/or modify it under
|
|
148 the terms of the GNU Lesser General Public License as published by the Free
|
|
149 Software Foundation; either version 3 of the License, or (at your option)
|
|
150 any later version.</p>
|
|
151 <p> </p><p> </p><div class="DocNav">
|
|
152 <table width="100%" border=0 cellpadding=0 cellspacing=2>
|
|
153 <tr align="left" valign="top"><td width="33%" align="left"><a href="./MergeTextFiles.html" title="MergeTextFiles.html">Previous</a> <a href="./index.html" title="Table of Contents">TOC</a> <a href="./ModifyNewLineChar.html" title="ModifyNewLineChar.html">Next</a></td><td width="34%" align="middle"><strong>March 29, 2015</strong></td><td width="33%" align="right"><strong>MergeTextFilesWithSD.pl</strong></td></tr>
|
|
154 </table>
|
|
155 </div>
|
|
156 <br />
|
|
157 <center>
|
|
158 <img src="../../images/h2o2.png">
|
|
159 </center>
|
|
160 </body>
|
|
161 </html>
|