Diff of /Input_files/tsv2pkl.py [000000] .. [c49071]

Switch to side-by-side view

--- a
+++ b/Input_files/tsv2pkl.py
@@ -0,0 +1,20 @@
+#When eigenvec or tsv are converted to PKL, the PANDAS version and model version should be the same as DNNGP.
+#So, please run the program in a DNNGP environment.
+import pandas as pd
+########Set path section
+inpath=r".\wheat599_pc95.tsv" #Set input path
+outpath=r".\wheat599_pc95.pkl" #Set output path
+
+########Conversion format section
+inpath=inpath.replace('\\','/') #Replace '\' with '/' in the input path.
+outpath=outpath.replace('\\','/') #Replace '\' with '/' in the output path.
+if "eigenvec" in inpath:
+    Gene = pd.read_csv(inpath, sep='\t',header=0,index_col=1) #read eigenvec file.
+    del Gene['#FID'] #Delete the '#FID' column
+    Gene.to_pickle(outpath) #output pkl file
+elif "csv" in inpath:
+    Gene = pd.read_csv(inpath, sep=',',header=0,index_col=0) #read csv file.
+    Gene.to_pickle(outpath) #output pkl file
+else:
+    Gene = pd.read_csv(inpath, sep='\t',header=0,index_col=0) #read tsv file.
+    Gene.to_pickle(outpath) #output pkl file