Git Product home page Git Product logo

Comments (1)

clintval avatar clintval commented on September 26, 2024

Sure thing:

import sys
from sample_sheet import SampleSheet

def reverse_complement(string: str) -> str:
    return "<REVERSE_COMPLEMENTED_INDEX>"

url = 'https://raw.githubusercontent.com/clintval/sample-sheet/master/tests/resources/paired-end-single-index.csv'

sheet = SampleSheet(url)

for sample in sheet:
    sample.index = reverse_complement(sample.index)

sheet.write(sys.stdout)

Which will output the following to STDOUT:

[Header],,,,,,,,
IEM1FileVersion,4,,,,,,,
Investigator Name,jdoe,,,,,,,
Experiment Name,exp001,,,,,,,
Date,11/16/2017,,,,,,,
Workflow,SureSelectXT,,,,,,,
Application,NextSeq FASTQ Only,,,,,,,
Assay,SureSelectXT,,,,,,,
Description,A description of this flow cell,,,,,,,
Chemistry,Default,,,,,,,
,,,,,,,,
[Reads],,,,,,,,
151,,,,,,,,
151,,,,,,,,
,,,,,,,,
[Settings],,,,,,,,
CreateFastqForIndexReads,1,,,,,,,
BarcodeMismatches,2,,,,,,,
,,,,,,,,
[Data],,,,,,,,
Sample_ID,Sample_Name,index,Description,Library_ID,Read_Structure,Reference_Name,Sample_Project,Target_Set
1823A,1823A-tissue,<REVERSE_COMPLEMENTED_INDEX>,0.5x treatment,2017-01-20,151T8B151T,mm10,exp001,Intervals-001
1823B,1823B-tissue,<REVERSE_COMPLEMENTED_INDEX>,0.5x treatment,2017-01-20,151T8B151T,mm10,exp001,Intervals-001
1824A,1824A-tissue,<REVERSE_COMPLEMENTED_INDEX>,1.0x treatment,2017-01-20,151T8B151T,mm10,exp001,Intervals-001
1825A,1825A-tissue,<REVERSE_COMPLEMENTED_INDEX>,10.0x treatment,2017-01-20,151T8B151T,mm10,exp001,Intervals-001
1826A,1826A-tissue,<REVERSE_COMPLEMENTED_INDEX>,100.0x treatment,2017-01-20,151T8B151T,mm10,exp001,Intervals-001
1826B,1823A-tissue,<REVERSE_COMPLEMENTED_INDEX>,0.5x treatment,2017-01-17,151T8B151T,mm10,exp001,Intervals-001
1829A,1823B-tissue,<REVERSE_COMPLEMENTED_INDEX>,0.5x treatment,2017-01-17,151T8B151T,mm10,exp001,Intervals-001

Replace sys.stdout with an open file handle to write to a file.

Since you want to mutate I5 index. Reference index2 instead of index.

from sample-sheet.

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.