Comments (1)
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)
- Support Python2 HOT 1
- Support comments HOT 2
- Feature Request: SampleSheet v2 support HOT 9
- validator HOT 7
- index validation HOT 2
- Intended behavior of empty samplesheet with missing sections HOT 1
- Index validation on indexes with spaces at the end
- Request - handling nonstandard tables HOT 1
- relationship with PEP HOT 1
- Issue1: special character
- Confusing error on file with no sections
- test_to_picard_basecalling_params_output_files fails on MacOS
- Appetite for looking up samples by Sample_ID HOT 1
- Feature request: support read structures like `+T` HOT 1
- PE + Multi index HOT 2
- Add option do deactivate sanity check for reading sample sheets and adding samples
- Sample_ID validation
- Do you support custom application settings and data sections? does Illumina? HOT 1
- Error parsing samplesheet HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sample-sheet.