728x90

๋ฐ์ดํ„ฐ๋ถ„์„ 26

SQL UNION, UNIONALL, NOT IN, IN

UNION ๋‘ ์ฟผ๋ฆฌ์˜ ๊ฒฐ๊ณผ๋ฅผ ํ–‰์œผ๋กœ ํ•ฉ์น˜๋Š” ์—ฐ์‚ฐ์ž ์ฟผ๋ฆฌ ๊ฒฐ๊ณผ ์ถœ๋ ฅ ์‹œ ์ค‘๋ณต๋œ ๊ฒƒ ์ œ์™ธ SELECT [๋ฌธ์žฅ1] UNION [ALL] SELECT [๋ฌธ์žฅ2] UNION ALL ๋‘ ์ฟผ๋ฆฌ์˜ ๊ฒฐ๊ณผ๋ฅผ ํ–‰์œผ๋กœ ํ•ฉ์น˜๋Š” ์—ฐ์‚ฐ์ž UNION๊ณผ ๋‹ค๋ฅด๊ฒŒ ์ค‘๋ณต๋œ ๊ฒƒ๋„ ๋‹ค ์ถœ๋ ฅ NOT IN ์ฒซ ๋ฒˆ์งธ ์ฟผ๋ฆฌ์˜ ๊ฒฐ๊ณผ ์ค‘์—์„œ ๋‘ ๋ฒˆ์งธ ์ฟผ๋ฆฌ์— ํ•ด๋‹นํ•˜๋Š” ๊ฒƒ ์ œ์™ธํ•˜๊ณ  ์ถœ๋ ฅ SELECT * FROM [ํ…Œ์ด๋ธ”๋ช…] WHERE [์กฐ๊ฑด ์—ด] NOT IN (์„œ๋ธŒ์ฟผ๋ฆฌ) ์ฐธ๊ณ ) MySQL ๊ธฐ์ดˆ์—์„œ ์‹ค๋ฌด๊นŒ์ง€ ์™„์ „์ •๋ณต ํ•˜๊ธฐ - ์•„์ดํ‹ฐ๊ณ  ์‹ ๊ฒฝ์ง„ ๊ฐ•์‚ฌ

[MySQL] ๋Œ€์šฉ๋Ÿ‰ ํ…Œ์ด๋ธ” csv, txt ํŒŒ์ผ ํ˜•ํƒœ๋กœ ๋‚ด๋ณด๋‚ด๊ธฐ & ๋ถˆ๋Ÿฌ์˜ค๊ธฐ

txt ํŒŒ์ผ๋กœ ๋‚ด๋ณด๋‚ด๊ธฐ select * from [ํ…Œ์ด๋ธ”๋ช…] into outfile '[ํŒŒ์ผ๋ช…].txt' character set utf8mb4 fields terminated by ',', optionally enclosed by '"' escaped by '\\' lines terminated by '\n'; csv ํŒŒ์ผ๋กœ ๋‚ด๋ณด๋‚ด๊ธฐ select * from [ํ…Œ์ด๋ธ”๋ช…] into outfile '[ํŒŒ์ผ๋ช…].csv' character set utf8mb4 fields terminated by ',', optionally enclosed by '"' escaped by '\\' lines terminated by '\n'; txt ํŒŒ์ผ ํ…Œ์ด๋ธ”๋กœ ์ฝ์–ด์˜ค๊ธฐ load data infile '[ํŒŒ์ผ๋ช…].txt' ..

DB(Database)/MySQL 2021.02.09

[Data Analysis] ๋ฐ์ดํ„ฐ ๋ถ„์„ ๊ณผ์ •, ์ „์ฒ˜๋ฆฌ์˜ ์ค‘์š”์„ฑ

๋ฐ์ดํ„ฐ ๋ถ„์„ ๊ณผ์ •(Data Analysis Process) 1. Goal Definition ๊ฐ๊ด€์ , ๊ตฌ์ฒด์ ์œผ๋กœ ๋ถ„์„ ๋Œ€์ƒ ์ •์˜(=๋ฌธ์ œ ์ •์˜) ํ•ด๋‹น ๋„๋ฉ”์ธ์— ๋Œ€ํ•œ ์ดํ•ด ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์— ๋Œ€ํ•œ ์ดํ•ด 2. Data Searching & Collecting ๋ฌธ์ œ ์ •์˜ ํ›„ ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ ๊ฒ€์ƒ‰ ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘ ๋ฐ ๋ฐ์ดํ„ฐ ํŒŒ์•… 3. Data Preparation ๋ฐ์ดํ„ฐ์˜ noise๋ฅผ ์ œ๊ฑฐํ•˜๊ณ  ์›ํ•˜๋Š” ํ˜•ํƒœ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณ€ํ™˜ํ•˜๋Š” Data preprocessing(๋ฐ์ดํ„ฐ ์ „์ฒ˜๋ฆฌ ๊ณผ์ •)ํฌํ•จ ์ตœ์ข… ๋ชจ๋ธ์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•œ ๋ฐ์ดํ„ฐ ์ค€๋น„ ๋‹จ๊ณ„ ๊ด€๋ จ ๋ฐ์ดํ„ฐ๋ผ๋ฆฌ ๊ด€๊ณ„ ์„ค์ • ๋ฐ ๋ฐ์ดํ„ฐ ์ดํ•ด, ๋ฐ์ดํ„ฐ ๋ณ‘ํ•ฉ 4. Modeling ์–ด๋–ป๊ฒŒ ๋ชจ๋ธ ์„ค๊ณ„ํ• ์ง€ ๊ตฌ์„ฑ R, Python ๋“ฑ ์ด์šฉํ•ด ๋จธ์‹ ๋Ÿฌ๋‹ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๋“ฑ ๋‹ค์–‘ํ•œ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ์ ์šฉ 5. Evaluatio..

[Deep Learning] ๋”ฅ๋Ÿฌ๋‹/๋จธ์‹ ๋Ÿฌ๋‹/์ธ๊ณต์ง€๋Šฅ์˜ ์ฐจ์ด, ์ธ๊ณต์‹ ๊ฒฝ๋ง ๊ฐœ๋…

๋”ฅ๋Ÿฌ๋‹์— ๋Œ€ํ•ด ์ดํ•ดํ•˜๋ ค๋ฉด ๋จผ์ € ์ธ๊ณต์ง€๋Šฅ, ๋จธ์‹ ๋Ÿฌ๋‹, ๋”ฅ๋Ÿฌ๋‹์˜ ์ฐจ์ด์ ์„ ์•Œ์•„์•ผํ•œ๋‹ค. ์ธ๊ณต์ง€๋Šฅ(AI): ์‚ฌ๋žŒ์˜ ์ง€๋Šฅ์„ ๋ชจ๋ฐฉํ•ด ์‚ฌ๋žŒ์ด ํ•˜๋Š” ๋ณต์žกํ•œ ์ผ์„ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๊ณ„๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ ๋จธ์‹ ๋Ÿฌ๋‹(ML): ์ž…๋ ฅ๋˜์–ด ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ํ†ตํ•ด ๊ฐ๊ฐ์˜ ์ƒํ™ฉ์— ๋งž๋„๋ก ํ•™์Šต์‹œํ‚ค๋Š” ๊ฒƒ ๋”ฅ๋Ÿฌ๋‹(DL): ๋จธ์‹ ๋Ÿฌ๋‹์œผ๋กœ ํ•™์Šตํ•œ ๋ถ€๋ถ„๋“ค์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์Šค์Šค๋กœ ํŒ๋‹จํ•ด ์ƒˆ๋กญ๊ฒŒ ๋Œ€์ฒ˜ํ•˜๋Š” ๊ฒƒ (=end-to-end machine learning) ๋”ฅ๋Ÿฌ๋‹์ด end-to-end machine learning์ธ ์ด์œ ๋Š” ์ฒ˜์Œ๋ถ€ํ„ฐ ๋๊นŒ์ง€ ์ปดํ“จํ„ฐ๊ฐ€ ํ•™์Šตํ•˜๋Š” ๊ฒƒ์œผ๋กœ, ๋จธ์‹ ๋Ÿฌ๋‹์ฒ˜๋Ÿผ ์‚ฌ๋žŒ์ด ๋ฐ์ดํ„ฐ์—์„œ ์ผ๋ถ€ ํŠน์ง•์„ ๋ฝ‘์•„์„œ ๊ธฐ๊ณ„์—๊ฒŒ ์ „๋‹ฌํ•ด ํ•™์Šต์‹œํ‚ค๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ๋ฐ์ดํ„ฐ ์ž์ฒด๋ฅผ ์ปดํ“จํ„ฐ์— ์ „๋‹ฌํ•˜๋Š” ๋“ฑ ์‚ฌ๋žŒ์˜ ๊ฐœ์ž…์ด ์•„์˜ˆ ์—†๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ์ธ๊ณต์ง€๋Šฅ, ๋จธ์‹ ๋Ÿฌ๋‹, ๋”ฅ๋Ÿฌ๋‹์˜ ์ •์˜๋ฅผ ..

JSON ๋ฐ์ดํ„ฐ๋ž€? + MySQL ๋Œ€์šฉ๋Ÿ‰ ๋ฐ์ดํ„ฐ ์ €์žฅ ํ˜•์‹

JSON ํ˜•์‹์ด๋ž€? JSON (JavaScript Object Notation) ์›น ํ™˜๊ฒฝ์ด๋‚˜ ๋ชจ๋ฐ”์ผ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ๋“ฑ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ตํ™˜ํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“  ๊ฐœ๋ฐฉํ˜• ํ‘œ์ค€ ํฌ๋งท ์†์„ฑ(KEY)๊ณผ ๊ฐ’(VALUE) ์Œ์œผ๋กœ ๊ตฌ์„ฑ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์–ธ์–ด์—์„œ ํŒŒ์ƒ๋˜์—ˆ์ง€๋งŒ ํŠน์ • ์–ธ์–ด์— ์ข…์†๋˜์ง€ ์•Š๊ณ  ๊ตํ™˜ํ•  ์ˆ˜ ์žˆ๋Š” ๋…๋ฆฝ์ ์ธ ๋ฐ์ดํ„ฐ ํฌ๋งท ํฌ๋งท์ด ๋‹จ์ˆœ, ๊ณต๊ฐœ๋˜์–ด ์žˆ์–ด ๊ฑฐ์˜ ๋Œ€๋ถ€๋ถ„์˜ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์—์„œ ์‰ฝ๊ฒŒ ์ฝ๊ฑฐ๋‚˜ ์“ธ ์ˆ˜ ์žˆ๋„๋ก ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๊ฐ€๋Šฅ โ€ป ์ตœ๊ทผ ๊ธฐ์กด ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์—์„œ NoSQL๋กœ์˜ ๋ณ€ํ™”๊ฐ€ ์ด๋ฃจ์–ด์ง€๊ณ  ์žˆ๋Š”๋ฐ, ์ด๋•Œ JSON ํ˜•ํƒœ๋Š” ๋งค์šฐ ์ค‘์š” โ€ป But, ๊ด€๊ณ„ํ˜• ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๋ฅผ ์•Œ์•„์•ผ NoSQL ํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ˆ™์ง€ ํ•„์ˆ˜ JSON_OBJECT() ์ฟผ๋ฆฌ๋ฌธ ๊ฒฐ๊ณผ๋ฅผ JSON ํ˜•ํƒœ๋กœ ๋ฐ”๊ฟ”์ฃผ๋Š” ํ•จ์ˆ˜ @json ๋ณ€์ˆ˜์— JSON ๋ฐ์ดํ„ฐ..

[MySQL] ๋‚ด์žฅํ•จ์ˆ˜ - ์ˆ˜ํ•™ ํ•จ์ˆ˜, ๋‚ ์งœ/์‹œ๊ฐ„ ํ•จ์ˆ˜, ์‹œ์Šคํ…œ/์ •๋ณด ํ•จ์ˆ˜

์ˆ˜ํ•™ ํ•จ์ˆ˜ ABS(์ˆซ์ž) : ์ ˆ๋Œ€๊ฐ’ ๊ณ„์‚ฐ CEILING(์ˆซ์ž) : ์˜ฌ๋ฆผ FLOOR(์ˆซ์ž) : ๋‚ด๋ฆผ ROUNG(์ˆซ์ž) : ๋ฐ˜์˜ฌ๋ฆผ CONV(์ˆซ์ž, ๊ธฐ์กด ์ง„์ˆ˜, ๋ฐ”๊ฟ€ ์ง„์ˆ˜) : ๊ธฐ์กด ์ง„์ˆ˜์—์„œ ๋‹ค๋ฅธ ์ง„์ˆ˜๋กœ ๋ฐ”๊ฟ”์ฃผ๋Š” ํ•จ์ˆ˜ SELECT ABS(-100); SELECT CEILING(4.7), FLOOR(4.7), ROUND(4.7); SELECT CONV('AA',16,2), CONV(100,10,8); -- 16์ง„์ˆ˜ AA๋ฅผ 2์ง„์ˆ˜๋กœ ๋ณ€๊ฒฝ, 10์ง„์ˆ˜์˜ 100์„ 8์ง„์ˆ˜๋กœ ๋ณ€๊ฒฝ MOD(์ˆซ์ž1, ์ˆซ์ž2), ์ˆซ์ž1 % ์ˆซ์ž2 : ์ˆซ์ž1์„ ์ˆซ์ž2๋กœ ๋‚˜๋ˆˆ ๋‚˜๋จธ์ง€ ๋ฐ˜ํ™˜ POW(์ˆซ์ž1, ์ˆซ์ž2) : ์ˆซ์ž1์„ ์ˆซ์ž2๋งŒํผ ๊ฑฐ๋“ญ์ œ๊ณฑํ•œ ๊ฐ’ ๋ฐ˜ํ™˜ SQRT(์ˆซ์ž) : ์ˆซ์ž์˜ ์ œ๊ณฑ๊ทผ ๋ฐ˜ํ™˜ select mod(228, 10), 228%10, ..

DB(Database)/MySQL 2021.02.06

siRNA, RNAi, off-target effect

RNAi(RNA interference) siRNA(short interfering RNA)๋ผ ๋ถˆ๋ฆฌ๋Š” 12~21 mer์˜ dsRNA์— ์˜ํ•ด ์„œ์—ด ํŠน์ด์ ์œผ๋กœ ์œ ์ „์ž ๋ฐœํ˜„์ด ์–ต์ œ๋˜๋Š” ํ˜„์ƒ --> RNA ๊ฐ„์„ญ gene silencing by RNAi RNA ๊ฐ„์„ญ์„ ์ด์šฉํ•ด ํŠน์ • ์œ ์ „์ž์˜ ํ™œ์„ฑ์„ ์–ต์ œํ•  ์ˆ˜ ์žˆ์Œ ํ‘œ์  mRNA์™€ ์ƒ๋ณด์  ๊ด€๊ณ„์— ์žˆ๋Š” ์ด์ค‘๊ฐ€๋‹ฅ RNA ๋ฅผ ์„ธํฌ์— ๋„์ž…ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ์–ต์ œ ๊ฐ€๋Šฅ ๋‹จ์ : ํšจ๊ณผ๊ฐ€ ์ผ์‹œ์ ์ผ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋‹ค๋ฅธ ์œ ์ „์ž ๋ฐœํ˜„๋„ ์–ต์ œํ•  ์ˆ˜ ์žˆ์Œ siRNA(short interfering RNA) off-target effect ์ค„์—ฌ์„œ design ํ•ด์•ผํ•จ Off-target effect siRNA๋ฅผ ์ด์šฉํ•œ RNAi์˜ ๋ถ€์ž‘์šฉ, ๋‹ค๋ฅธ ์œ ์ „์ž ๋ฐœํ˜„๋„ ์–ต์ œ๋˜๋Š” ํ˜„์ƒ https://www.ibri..

Bioinfomatics 2021.02.03

[Python] Pandas dataframe ๊ฒฐํ•ฉ, ์กฐ์ธ, ๋ณ‘ํ•ฉ(Join, Merge)

Join 1. ์˜ˆ์‹œ ๋ฐ์ดํ„ฐํ”„๋ ˆ์ž„ ์ƒ์„ฑ import pandas as pd df = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'], 'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']}) other = pd.DataFrame({'key': ['K0', 'K1', 'K2'], 'B': ['B0', 'B1', 'B2']}) 2. ์—ด์˜ Index ์ง€์ •ํ•ด์„œ Join df.join(other, lsuffix = '_caller', rsuffix = '_other') 3. Key๋ฅผ index๋กœ ์ง€์ •ํ•ด Join df.set_index('key').join(other.set_index('key')) 4. join ๋ฉ”์†Œ๋“œ์˜ parameter ..

728x90