Excerpts from Mary Goldman's message of Thu Aug 12 22:27:16 +0000 2010:

> I'm sorry, but we do not have the tools here to do that. I looked at the 
> Galaxy website (http://main.g2.bx.psu.edu/), and some of their tools may 
> be of use to you, particularly those under the "Fetch Alignments" 

While I hope these tools may be of use, we don't currently have any
tools there for sorting MAF files.

> >> Thanks for your consideration. I am familiar with mafOrder; it
> >> changes the order of species in the alignments. To my knowledge it
> >> does not sort and, when required, reverse complement the output. You
> >> see, I would like to use the re-ordered maf file as input for
> >> hgLoadMaf, which requires a sorted (i.e. corectly ordered) maf file
> >> in + orientation as input.

I believe "maf_sort" in the multiz/tba package [1] will accomplish what
you want. I have successfully loaded MAFs produced by it with hgLoadMaf.

[1] http://www.bx.psu.edu/miller_lab/dist/multiz-tba.012109.tar.gz

However, it will only work if you are sorting MAF files with only a
single src. You may want to split these (mafSplit), since other tools
(mafAddIRows) also ignore src. Alternatively, you may have luck patching
maf_sort:


--- multiz-tba.012109.orig/maf_sort.c   2009-01-21 17:31:56.000000000 -0500
+++ multiz-tba.012109/maf_sort.c        2010-04-13 15:15:12.086319600 -0400
@@ -17,7 +17,12 @@
 }
 
 int compar_start(const void* a, const void* b) {
-    return (*((struct mafAli **)a))->components->start - (*((struct mafAli 
**)b))->components->start;
+    int scomp = strcmp( (*((struct mafAli **)a))->components->src, (*((struct 
mafAli **)b))->components->src );
+    if ( scomp == 0 ) {
+        return (*((struct mafAli **)a))->components->start - (*((struct mafAli 
**)b))->components->start;
+    } else {
+        return scomp;
+    } 
 }
 

-- jt
_______________________________________________
Genome maillist  -  [email protected]
https://lists.soe.ucsc.edu/mailman/listinfo/genome

Reply via email to