I am writing a script to sort a file based on a specific column. I tried calling the 'sort' Linux command for this. The code I am using is:
from subprocess import
path_store = /homes/varshith/maf
input = path_store
field = "-k2"
store_output_in_new_file = ">"
new_path = path_store + "_sort.bed"
sorting = Popen(["sort", field, input, append, new_path], stdout=PIPE)
But this doesn't work properly. Thanks in advance for helping.