Code Monkey home page Code Monkey logo

Comments (4)

frederic-mahe avatar frederic-mahe commented on August 19, 2024

The output format of Mothur's clusters is described on that page: http://www.mothur.org/wiki/List_file

from swarm.

accaldwell avatar accaldwell commented on August 19, 2024

Appears to be fairly trivial to convert swarm's output to a mothur compatible list file:

tr '\n' '\t' < test.swarms > test.swarms.list.tmp1
tr ' ' ',' < test.swarms.list.tmp1 > test.swarms.list.tmp2
echo -e "d1\t12345\t" | cat test.swarms.list.tmp2 > test.list

where d1 is my -d level, and 12345 is the number of produced OTUs. Tested with mothurs make.shared command, then ran a short analysis on the shared file.

from swarm.

frederic-mahe avatar frederic-mahe commented on August 19, 2024

Hi Adam,

indeed it is trivial. If I may, I suggest some modifications to avoid using intermediate files:

SWARMS="test.swarms"
OTUs=$(wc -l < "${SWARMS}")
(echo -ne "d1\t${OTUs}\t" ; tr "\n" "\t" < "${SWARMS}" | tr " " ",") > test.list

I also used the -n option of echo to avoid the automatic \n character. What do you think of that code block?

from swarm.

torognes avatar torognes commented on August 19, 2024

This feature is now implemented in the SWARM code. Option -r or --mothur will format the output file according to the mothur list file format.

from swarm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.