title: Merge many tsv files by common key using Python pandas
body: <p>I have several hundred tsv files with two fields, a common key and a unique sample id: </p>
  
  <pre><code>==&gt; test1.vmat &lt;==
  CHROM:POS:REF:ALT  144-93-02
  1:14653:C:T  1
  1:14677:G:A  1
  1:14907:A:G  1
  
  ==&gt; test2.vmat &lt;==
  CHROM:POS:REF:ALT  144-93-01
  1:14653:C:T  1
  1:14522:G:A  1
  1:14907:A:G  1
  </code></pre>
  
  <p>I would like to perform an outer join on all of the files using the field "CHR:POS:REF:ALT" to form one giant matrix. Example for two files:</p>
  
  <pre><code>CHROM:POS:REF:ALT  144-93-02    144-93-01
  1:14653:C:T  1.0 1.0
  1:14522:G:A  NA 1.0
  1:14677:G:A  1.0 NA
  1:14907:A:G  1.0 1.0
  </code></pre>
  
  <p>I got the output above using the following code, but I am having trouble looping over the hundreds of *tsv files in the directory (path/to/testN.vmat).  how can I modify this into something that will merge all the individual *tsv files from a directory into a single tsv file?</p>
  
  <pre><code>variant_field = "CHROM:POS:REF:ALT"
  outfile = "everyone.vmat"
  
  df1 = pandas.read_csv("path/to/test1.vmat", sep='\t', parse_dates=False)
  df2 = pandas.read_csv("path/to/test2.vmat", sep='\t', parse_dates=False)
  
  df3 = pandas.merge(df1,df2,on=variant_field, how='outer')
  df3.to_csv(str(outfile), sep="\t", header=True, index=False, na_rep="NA", engine='python')
  </code></pre>